/* Шрифт Inter (SIL Open Font License, fonts/LICENSE-Inter.txt), хранится на нашем сервере */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(/fonts/inter-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Тёмная тема в стиле лендинга: цвета и отсветы взяты из его кода */
:root {
  --bg: #07070a;
  --bg-2: rgba(0, 0, 0, .35);
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-solid: #121216;
  --border: rgba(255, 255, 255, .12);
  --text: #fff;
  --muted: #b5b5bd;
  --accent: #e5384e;
  --accent-2: #f26d7d;
  --accent-hover: #ef5064;
  --accent-soft: rgba(229, 56, 78, .16);
  --ok: #46d369;
  --warn: #f5b50a;
  --bad: #ff5a5f;
  --radius: 14px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -5%, rgba(229, 56, 78, .32), transparent 60%),
    radial-gradient(800px 700px at -5% 40%, rgba(120, 10, 30, .35), transparent 60%),
    radial-gradient(900px 700px at 100% 95%, rgba(90, 10, 60, .35), transparent 60%),
    linear-gradient(160deg, #07070a 0%, #12060b 45%, #07070a 100%);
}
a { color: #fff; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; }
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 { font-size: 1.2rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 12px;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-2);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); flex: none; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mt { margin-top: 1.4em; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.row > h2 { margin: 0; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(7, 7, 10, .92), rgba(7, 7, 10, .7));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand {
  margin: 0;
  font-weight: 400; font-size: 1.35rem; letter-spacing: .01em;
  color: var(--accent); text-decoration: none; text-transform: uppercase;
  white-space: nowrap;
}
.brand span {
  margin-left: 6px; color: var(--muted);
  font-size: .72rem; letter-spacing: .2em; vertical-align: middle;
}
.brand:hover { color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand picture { display: block; }
.brand-logo { display: block; height: 44px; width: auto; margin: -4px 0 -4px -10px; }
.login-card .brand-logo { height: 60px; margin-bottom: -6px; }
@media (max-width: 520px) { .brand-logo { height: 30px; margin: 0; } }
.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 8px 24px;
  background: rgba(60, 45, 0, .45); color: #ffd98a; border-bottom: 1px solid rgba(255, 200, 80, .2);
  font-size: .9rem;
}
.demo-bar label { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border: 1px solid transparent; border-radius: 8px;
  background: rgba(255, 255, 255, .14); color: var(--text);
  font-weight: 400; text-decoration: none; cursor: pointer;
  transition: background .25s, box-shadow .25s, transform .25s;
}
.btn:hover { background: rgba(255, 255, 255, .2); color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(229, 56, 78, .35); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 10px 34px rgba(229, 56, 78, .55); transform: translateY(-1px); }
.btn-ghost { background: rgba(109, 109, 110, .45); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(160, 160, 160, .45); }
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-block { width: 100%; padding: 12px; font-size: 1.05rem; }
.btn.danger { color: var(--bad); border-color: #5a2224; }
.icon-btn { background: none; border: 0; padding: 4px 8px; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; cursor: pointer; }

.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
}
.input:focus { border-color: rgba(255, 255, 255, .45); outline: none; }
select.input option { background: var(--surface-solid); }
textarea.input { resize: vertical; }
.input.code { font: .875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.input-sm { width: auto; padding: 5px 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: .875rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 6px 0; cursor: pointer; }
.check input, .option input, .opt-row input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

/* ---------- Карточки и метки ---------- */
.panel, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card { padding: 20px; margin-bottom: 16px; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.pill-ok { background: #0f3320; color: var(--ok); }
.pill-warn { background: #3a2b00; color: var(--warn); }
.pill-bad { background: #3d1214; color: var(--bad); }
.pill-info { background: #12304f; color: #9fcbff; }
.lvl {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.lvl + .lvl { margin-left: 4px; }
.lvl-1 { background: rgba(255, 255, 255, .14); color: #ddd; }
.lvl-2 { background: #12304f; color: #9fcbff; }
.lvl-3 { background: var(--accent-soft); color: #f7a3ad; }
.group-pill { margin-left: 6px; }

/* Вкладка «Группы» в админке */
.group-level { margin-bottom: 28px; }
.group-level-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.group-level-head h2 { margin: 0; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.group-card { margin-bottom: 0; }
.group-card .row { margin-bottom: 10px; }
.group-members { list-style: none; margin: 0 0 12px; padding: 0; }
.group-members li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.group-members li > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.group-members select { max-width: 150px; }
.check-group { display: block; margin: 8px 0 4px; font-weight: 700; }
.counter {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; text-align: center;
}
.demo-card { padding: 14px 16px; border: 1px dashed #6b5200; background: #1f1900; border-radius: var(--radius); margin-bottom: 16px; color: #ffe2a6; }
.demo-card p:last-child { margin: 0; }

/* ---------- Кабинет ученика ---------- */
/* Слева модули и темы, в центре урок, справа созвоны и под ними чат */
.cabinet {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  grid-template-areas: "nav content calls" "nav content chat";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 16px 28px;
  max-width: 1600px; margin: 0 auto;
  padding: 20px 24px 40px;
}
#calls { grid-area: calls; padding: 16px; }
#nav { grid-area: nav; position: sticky; top: 80px; }
#content { grid-area: content; min-width: 0; }
#chat { grid-area: chat; position: sticky; top: 80px; }
#content .lesson, #content .promo { margin: 0 auto; }

.calls h2 { font-size: 1rem; margin-bottom: 10px; }
.calls-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.calls-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 3px solid var(--accent); }
.calls-list time { font-size: .8rem; color: var(--muted); }

.nav-toggle { display: none; }
.nav-list { padding: 6px 8px 10px; max-height: calc(100vh - 110px); overflow-y: auto; }
.nav-module { --mod: var(--accent); }
.nav-module.mod-2 { --mod: #9b2fae; }
.nav-module.mod-3 { --mod: #3d63c9; }
.nav-module.mod-4 { --mod: #e0621c; }
.nav-module.mod-5 { --mod: #7a3fd0; }
.nav-module h3 {
  display: flex; flex-direction: column; gap: 2px;
  margin: 14px 4px 6px; padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mod) 30%, transparent), transparent 80%);
  font-size: 1rem; font-weight: 500; color: #fff;
}
.nav-module-num { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .7); font-weight: 400; }
.nav-module ul { list-style: none; margin: 0; padding: 0; }
.nav-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { flex: none; width: 18px; text-align: center; color: var(--ok); }
.nav-item.next .nav-icon { color: var(--accent); }
.nav-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.chat-panel > header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.chat-panel > header h2 { font-size: 1rem; margin-bottom: 2px; }
.chat-panel > header p { margin: 0; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-list { height: 380px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card .chat-list { padding: 12px 0; }
.chat-empty { margin: auto; }
.msg { max-width: 88%; align-self: flex-start; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.msg-mine { align-self: flex-end; background: var(--accent-soft); }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; font-size: .75rem; color: var(--muted); }
.msg-author { font-weight: 700; color: #ccc; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tag { padding: 1px 6px; border-radius: 4px; font-size: .7rem; font-weight: 700; }
.tag-personal { background: #16324f; color: #9fcbff; }
.tag-group { background: #3b2a00; color: #ffd27a; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.card .chat-form { padding: 10px 0 0; }
.chat-form textarea {
  flex: 1; min-width: 0; max-height: 140px; resize: none;
  padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
}
.chat-form textarea:focus { border-color: #888; outline: none; }

.lesson { max-width: 820px; }
.lesson .eyebrow { margin-bottom: 8px; }
.lesson-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.lesson-head h1 { margin: 0; }
.lesson-body { margin-bottom: 24px; font-size: 1.05rem; overflow-wrap: anywhere; }
.lesson-body img, .lesson-body video, .lesson-body iframe { max-width: 100%; height: auto; border-radius: 8px; }
.lesson-body iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.question { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.question legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.option {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
.option:hover { border-color: #5a5a5a; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.test-result { margin: 0; }
.test-result.err { color: var(--bad); }
.ok { color: var(--ok); font-weight: 700; }
.help-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.review-ok { border-color: #1d5a35; }
.review-warn { border-color: #6b5200; }

.promo {
  padding: 40px 36px; border-radius: 18px;
  border: 1px solid rgba(229, 56, 78, .35);
  background: linear-gradient(150deg, rgba(229, 56, 78, .28) 0%, rgba(255, 255, 255, .04) 70%);
  max-width: 820px;
}
.promo-code {
  display: inline-block; margin: 4px 0 16px; padding: 12px 22px;
  border: 2px dashed var(--accent); border-radius: 8px;
  font: 800 1.7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em;
}
.support-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Вход ---------- */
.login-page { display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(440px, 100%); padding: 36px 32px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 18px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.login-card .brand { display: block; width: max-content; margin-bottom: 28px; }
.login-card form { margin: 18px 0 10px; }
.login-card .test-result { min-height: 1.5em; margin-bottom: 8px; }
.login-help { margin-bottom: 20px; }
.login-demo { margin: 0; }

/* ---------- Модальные окна и уведомления ---------- */
.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-solid); color: var(--text);
}
.modal-wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 0 20px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 14px 20px 20px; }
.modal .chat-list { height: 340px; padding: 12px 0; }
.modal .chat-form { padding: 10px 0 0; }
.pwd-box {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2);
  font: 600 1.05rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.toasts {
  position: fixed; left: 50%; bottom: 16px; z-index: 100; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 16px; border-radius: 8px;
  background: #f2f2f2; color: #111; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Админка ---------- */
.admin-tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  padding: 0 24px; border-bottom: 1px solid var(--border);
}
.admin-tabs button {
  padding: 13px 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer;
}
.admin-tabs button:hover { color: #fff; }
.admin-tabs button.active { color: #fff; border-bottom-color: var(--accent); }
.admin-main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar h1 { margin: 0 auto 0 0; font-size: 1.5rem; }
.toolbar .input[type="search"] { width: 280px; max-width: 100%; }
.toolbar-note { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; min-width: 820px; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { background: var(--bg-2); color: var(--muted); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }
.row-blocked td { opacity: .55; }

.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 20px; }
.split-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.list-item {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
}
.list-item:hover { border-color: #4a4a4a; }
.list-item.active { border-color: var(--accent); }
.list-item .preview { overflow: hidden; color: var(--muted); font-size: .875rem; white-space: nowrap; text-overflow: ellipsis; }
.answer { padding: 12px 14px; margin-bottom: 16px; border-radius: 8px; background: var(--bg-2); }
.call-card { margin: 0; }
.call-card a { overflow-wrap: anywhere; }
.pick-list { max-height: 240px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.check-row { display: flex; }

.tree { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tree-module { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.tree-module summary {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 14px; font-weight: 700; cursor: pointer; list-style: none;
}
.tree-module summary::-webkit-details-marker { display: none; }
.tree-module summary::before { content: "▸"; color: var(--muted); }
.tree-module[open] summary::before { content: "▾"; }
.tree-module summary > span:first-child { flex: 1; }
.tree-module ul { list-style: none; margin: 0; padding: 0 6px; }
.tree-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 6px;
  background: none; color: var(--text); text-align: left; cursor: pointer; font-size: .92rem;
}
.tree-item:hover { background: var(--surface-2); }
.tree-item.active { background: var(--accent-soft); }
.tree-actions { display: flex; gap: 8px; padding: 8px 14px 12px; }
.editor .q-editor { margin-bottom: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); }
.q-editor > .input { margin: 8px 0; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.editor-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- Телефон ---------- */
/* Средние экраны: созвоны и чат уходят под урок */
@media (max-width: 1200px) {
  .cabinet {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-areas: "nav calls" "nav content" "nav chat";
    grid-template-rows: auto auto 1fr;
  }
  #chat { position: static; }
}
@media (max-width: 860px) {
  .topbar, .demo-bar { padding-left: 16px; padding-right: 16px; }
  .cabinet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "calls" "nav" "content" "chat";
    grid-template-rows: auto;
    gap: 12px;
    padding: 12px 16px 32px;
  }
  #nav { top: auto; }
  #chat { position: static; }
  .nav-toggle {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
    padding: 12px 16px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer;
  }
  .nav-toggle::after { content: "▾"; position: absolute; right: 16px; top: 14px; color: var(--muted); }
  #nav { position: relative; }
  #nav.open .nav-toggle::after { content: "▴"; }
  .nav-toggle-label { font-weight: 700; }
  .nav-toggle-current { font-size: .875rem; color: var(--muted); padding-right: 24px; }
  #nav:not(.open) .nav-list { display: none; }
  .nav-list { max-height: none; border-top: 1px solid var(--border); }
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
  .promo { padding: 24px 18px; }
  .admin-tabs { padding: 0 8px; }
  .admin-main { padding: 16px 16px 40px; }
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input[type="search"] { width: 100%; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .topbar { gap: 8px; }
  .msg { max-width: 94%; }
  /* Шапка кабинета на телефоне: группа переезжает к прогрессу, кнопки компактнее */
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .topbar .brand { font-size: 1.05rem; }
  #tariff-badge .group-pill { display: none; }
  .topbar .btn-sm { padding-left: 9px; padding-right: 9px; }
}
.nav-group { display: none; }
@media (max-width: 520px) { .nav-group { display: inline; } }

.nav-progress { margin: 0; padding: 12px 16px 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-progress:empty { display: none; }
.nav-empty { padding: 12px; }
@media (max-width: 520px) { .hide-sm { display: none; } }
.demo-bar { flex-direction: column; align-items: flex-start; gap: 2px; }
.call-card.past { opacity: .55; }
.chat-list.static { height: auto; max-height: 60vh; }
.pwd-box.letter { margin-top: 12px; font: .9rem/1.5 var(--font); font-weight: 400; }
.doc { max-width: 760px; margin: 0 auto; padding: 48px 24px 64px; }

/* ---------- Настройки ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.settings-card h2 { margin-bottom: 8px; }
.steps { margin: 8px 0 12px; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 4px; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.copy-row code { padding: 8px 12px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); overflow-wrap: anywhere; font-size: .85rem; }
.test-result.ok { color: var(--ok); }
.table-compact { min-width: 0; }
.promo-form { margin-top: 16px; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.doc-text { line-height: 1.65; }
.doc-text p { margin-bottom: 1em; }

/* ---------- Файлы: вложения в чате, плеер, загрузки ---------- */
.attach-btn { font-size: 1.25rem; padding: 6px; align-self: flex-end; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.attach-list:empty { display: none; }
.card .attach-list, .modal .attach-list { padding: 8px 0 0; }
.attach-item {
  position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--surface-2); font-size: .85rem; overflow: hidden;
}
.attach-item .icon-btn { font-size: 1.1rem; padding: 0 6px; }
.attach-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--accent); transition: width .2s; }
.attach-item.done .attach-bar { background: var(--ok); }
.attach-row { display: flex; align-items: center; gap: 8px; }
.chat.drop, .drop-zone.drop, textarea.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-size { color: var(--muted); font-size: .8em; white-space: nowrap; }
.msg-files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.msg-image img { display: block; max-width: 260px; max-height: 220px; border-radius: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .25); color: inherit; text-decoration: none;
}
.file-chip:hover { background: rgba(0, 0, 0, .4); }
.file-icon { font-size: 1.1em; }
.video-wrap { margin: 16px 0; }
.video-wrap video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.video-speed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.video-speed .btn.active { border-color: var(--accent); color: #fff; }
.lesson-body audio { width: 100%; }
.drop-zone { text-align: center; border-style: dashed; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.upload-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.upload-bar > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.upload-row.done .upload-bar > span { background: var(--ok); }
.upload-row.err .upload-bar > span { background: var(--bad); }
.pick-files { max-height: 50vh; overflow-y: auto; }
@media (max-width: 520px) { .msg-image img { max-width: 100%; } .file-name { max-width: 170px; } }
.warn { color: var(--warn); }
.file-chip.deleted { opacity: .55; cursor: default; }
.nav-access{display:block;margin-top:4px}
