/* Кабинет ученицы (и предпросмотр урока в админке).
   ВРЕМЕННО — в оформлении админки: те же токены (цвета, радиусы, тени), копия из /admin/admin.css.
   Файл самостоятельный: админку не подключаем, чтобы потом заменить всё одной бренд-системой. */

:root {
  --app-bg: #f3f1ee;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --hover: #f4f2ef;
  --active: #ebe8e3;
  --border: #e8e5e0;
  --border-strong: #d8d4cc;
  --text: #1c1a17;
  --text-2: #5b5650;
  --text-3: #8c867e;
  --primary: #1c1a17;
  --primary-hover: #000000;
  --on-primary: #ffffff;
  --accent: #b4536a;
  --accent-hover: #9e4559;
  --accent-soft: #f8ecef;
  --accent-text: #973f55;
  --ok: #17784a;
  --ok-soft: #e6f4ec;
  --warn: #9a5a06;
  --warn-soft: #fcf0dc;
  --info: #2457c5;
  --info-soft: #e9effc;
  --danger: #c0362c;
  --danger-soft: #fbeae8;
  --neutral-soft: #f0eeea;
  --r-s: 6px;
  --r: 8px;
  --r-l: 12px;
  --r-xl: 16px;
  --shadow-pop: 0 10px 30px rgba(28, 26, 23, 0.14), 0 0 0 1px rgba(28, 26, 23, 0.06);
  --font: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 248px;
}

/* ---------- тёмная тема (включает /learn/theme.js) ---------- */

:root[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #121110;
  --surface: #1a1816;
  --surface-2: #1f1d1a;
  --hover: #252220;
  --active: #2d2a27;
  --border: #2c2925;
  --border-strong: #3c3732;
  --text: #f1eeea;
  --text-2: #b9b2a9;
  --text-3: #8a837a;
  --primary: #f1eeea;
  --primary-hover: #ffffff;
  --on-primary: #121110;
  --accent: #e08aa0;
  --accent-hover: #eb9db1;
  --accent-soft: #3a2229;
  --accent-text: #f0a7b9;
  --ok: #63cf96;
  --ok-soft: #17301f;
  --warn: #e8b25a;
  --warn-soft: #33281a;
  --info: #93b4ff;
  --info-soft: #1d2740;
  --danger: #ff7b70;
  --danger-soft: #3a1f1c;
  --neutral-soft: #2a2724;
  --shadow-pop: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
:root[data-theme="dark"] .segmented button:hover { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .login { background: var(--app-bg); }
:root[data-theme="dark"] .login-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 10px 28px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .tabbar { background: rgba(26, 24, 22, 0.94); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--app-bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 16px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.005em; }
h3 { font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- кнопки ---------- */

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r);
  font: inherit; font-size: 14.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--hover); }
.btn-small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-large { height: 46px; font-size: 15.5px; }
.btn-done { background: var(--ok); color: #fff; }
.btn-done:hover { background: var(--ok); filter: brightness(0.92); }
:root[data-theme="dark"] .btn-done { color: #0f1a13; }

/* ---------- поля ---------- */

input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text);
  height: 40px; padding: 0 12px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; min-height: 88px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.field input { width: 100%; }
.error { color: var(--danger); font-size: 13px; margin: 0; }
.error:empty { display: none; }
.saved { color: var(--ok); font-size: 13px; margin: 0; }

/* ---------- вход ---------- */

/* как у Skyeng: без карточки, всё по центру, крупный знак и заголовок, поля без подписей сверху */
.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.login-top { padding: 22px 32px; }
.login-main {
  flex: 1; width: 100%; max-width: 380px; margin: 0 auto; padding: 24px 16px 15vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.login-mark { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 22px; box-shadow: 0 10px 28px rgba(28, 26, 23, 0.18); }
.login h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 28px; }
.login-form { width: 100%; display: grid; gap: 12px; }
.login-form input {
  width: 100%; height: 50px; padding: 0 16px; font-size: 16px;
  background: var(--neutral-soft); border-color: transparent; border-radius: var(--r-l);
}
.login-form input:hover { border-color: var(--border-strong); }
.login-form input:focus { background: var(--surface); border-color: var(--accent); }
.login-form button { width: 100%; height: 50px; border-radius: var(--r-l); font-size: 16px; margin-top: 4px; }
.login-form .error { text-align: center; }
.login-note { color: var(--text-3); font-size: 13.5px; line-height: 1.5; margin: 22px 0 10px; }
.login-link { font-size: 14.5px; font-weight: 500; }
@media (max-width: 600px) {
  .login-top { padding: 14px 16px; }
  .login-main { padding-bottom: 10vh; }
  .login h1 { font-size: 26px; margin-bottom: 22px; }
}

/* ---------- каркас: меню слева + белый лист ---------- */

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; display: block; flex-shrink: 0; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 16px 10px 12px; gap: 6px;
}
.sidebar .brand { padding: 2px 8px 14px; }
.nav { display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(28, 26, 23, 0.04); }
.nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav a.active svg { color: var(--accent); }

.sidebar-footer { margin-top: auto; display: grid; gap: 2px; padding-top: 10px; }
.me-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--text); }
.me-link:hover, .me-link.active { background: var(--hover); text-decoration: none; }
.me-text { display: grid; line-height: 1.25; min-width: 0; }
.me-text > span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text .muted { font-size: 12px; }
.sidebar-link { display: block; padding: 7px 10px; border-radius: var(--r); color: var(--text-3); font-size: 13.5px; }
.sidebar-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text);
}

.main-wrap { padding: 8px 8px 8px 0; min-width: 0; }
.main {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  min-height: calc(100vh - 16px); padding: 30px 40px 72px;
}
.learn-main > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.learn-main > .lesson-layout, .learn-main > .crumbs { max-width: 1180px; }

/* переключатель темы */
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 4px; color: var(--text-3); font-size: 13px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--neutral-soft); border-radius: var(--r); }
.segmented button { height: 28px; width: 32px; padding: 0; border-radius: var(--r-s); background: transparent; color: var(--text-2); border: 0; }
.segmented button:hover { background: rgba(255, 255, 255, 0.7); color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(28, 26, 23, 0.1), 0 0 0 1px rgba(28, 26, 23, 0.04); }
.segmented svg { width: 16px; height: 16px; }
.segmented.wide button { width: auto; padding: 0 12px; gap: 6px; font-size: 13.5px; }

/* ---------- общие блоки страниц ---------- */

.page-title { margin-bottom: 4px; }
.page-sub { color: var(--text-2); margin: 0 0 24px; }
.section-title { font-size: 16px; font-weight: 600; margin: 28px 0 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 20px 22px; margin-bottom: 16px; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  background: var(--accent-soft); border-radius: var(--r-l); padding: 14px 18px; margin-bottom: 16px; color: var(--text);
}
.notice p { margin: 0; flex: 1; min-width: 220px; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { border: 1px solid var(--border); border-radius: var(--r-l); padding: 16px 18px; background: var(--surface); }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile-link { color: var(--text); transition: border-color 0.12s; }
.tile-link:hover { text-decoration: none; border-color: var(--border-strong); }
.tile .value { font-size: 24px; line-height: 1.15; font-weight: 650; margin-top: 8px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }

.progress { height: 6px; background: var(--neutral-soft); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; }
.progress span { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width 0.3s; }
.progress-label { font-size: 13.5px; color: var(--text-2); margin-bottom: 18px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eyebrow-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }

/* обложка курса: пока без фото — тёмная плашка со знаком */
.cover {
  min-height: 180px; position: relative; display: flex; align-items: flex-end; padding: 18px 20px;
  background: radial-gradient(120% 140% at 100% 0%, #6b3a48 0%, #2b2522 55%, #1c1a17 100%); color: #fff;
}
.cover img { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.35); }

/* главная: «продолжить обучение» */
.continue { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; padding: 0; }
@media (min-width: 900px) { .continue { grid-template-columns: 320px minmax(0, 1fr); } }
.continue-body { padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; }
.continue-body h2 { font-size: 21px; margin-bottom: 4px; }
.continue-body .next { color: var(--text-2); margin-bottom: 14px; }

/* мои курсы */
.course-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.course-tile { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text); transition: box-shadow 0.15s, border-color 0.15s; }
.course-tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 6px 20px rgba(28, 26, 23, 0.08); }
.course-tile .cover { min-height: 140px; }
.course-tile .body { padding: 16px 18px 18px; }
.course-tile h3 { font-size: 16px; margin: 0 0 4px; }
.course-tile .meta { font-size: 13px; color: var(--text-3); margin-bottom: 12px; }

/* страница курса */
.course-head { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; overflow: hidden; }
@media (min-width: 900px) { .course-head { grid-template-columns: minmax(0, 1fr) 280px; } }
.course-head .info { padding: 22px 24px; }
.course-head .info h1 { margin-bottom: 6px; }
.course-head .side { padding: 22px 24px; background: var(--surface-2); border-left: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.big-number { font-size: 32px; font-weight: 650; line-height: 1; letter-spacing: -0.02em; }

.module { padding: 4px 0; }
.module + .module { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 16px; }
.module-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.module-head h3 { font-size: 14.5px; margin: 0; }
.module-head span { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.lesson-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 0 -12px; border-radius: var(--r); color: var(--text); }
.lesson-link:hover { background: var(--hover); text-decoration: none; }
.lesson-link.current { background: var(--active); }
.lesson-mark {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--neutral-soft); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border-strong);
}
.lesson-link.current .lesson-mark { background: var(--accent); color: #fff; box-shadow: none; }
.lesson-mark.done { background: var(--ok); color: #fff; box-shadow: none; }
.lesson-link .meta { margin-left: auto; font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* ---------- урок ---------- */

.crumbs { font-size: 13.5px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); }
.lesson-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .lesson-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.lesson-title { font-size: 26px; margin-bottom: 16px; }
.video {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--r-l); overflow: hidden; margin-bottom: 12px;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.status { font-size: 14px; color: var(--text-2); }
.status.done { color: var(--ok); font-weight: 500; }

.lesson-text { padding: 26px 28px; }
.lesson-text p { font-size: 16px; line-height: 1.65; white-space: pre-line; }
.lesson-text > :last-child { margin-bottom: 0; }
.lb-title { font-size: 20px; margin: 22px 0 8px; }
.lb-title:first-child { margin-top: 0; }
.lb-video { margin: 16px 0; }
.lb-link {
  display: flex; flex-direction: column; gap: 2px; margin: 12px 0; padding: 12px 16px;
  border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.lb-link:hover { background: var(--hover); text-decoration: none; }
.lb-link b { font-weight: 500; }
.lb-link span { font-size: 13px; color: var(--text-3); }
.lb-button { text-align: center; margin: 18px 0; }
.lb-divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.lb-image { margin: 18px 0; }
.lb-image a { display: block; }
.lb-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--r-l); background: var(--surface-2); }
.lb-image figcaption { font-size: 13.5px; color: var(--text-3); text-align: center; margin-top: 8px; }
.lb-file {
  display: flex; align-items: center; gap: 14px; margin: 12px 0; padding: 12px 16px;
  border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.lb-file:hover { background: var(--hover); text-decoration: none; }
.lb-file-ext {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; color: var(--text-2);
}
.lb-file-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-file-t b { font-weight: 500; overflow-wrap: anywhere; }
.lb-file-t span { font-size: 13px; color: var(--text-3); }

.lesson-text strong { font-weight: 650; }
.lb-list { margin: 0 0 12px; padding-left: 24px; font-size: 16px; line-height: 1.6; }
.lb-list li { margin: 3px 0; padding-left: 2px; }
.lb-list li::marker { color: var(--text-3); }

/* выноска «Важно / Совет / Заметка» */
.lb-callout { display: flex; gap: 12px; margin: 16px 0; padding: 14px 16px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--border); }
.lb-callout-ic { flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--text-2); }
.lb-callout-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-callout-body { min-width: 0; flex: 1; padding-top: 4px; }
.lb-callout-title { display: block; font-weight: 650; margin-bottom: 4px; }
.lb-callout-body p, .lb-callout-body .lb-list { font-size: 15px; margin-bottom: 6px; }
.lb-callout-body > :last-child { margin-bottom: 0; }
.lb-callout.tone-important { background: var(--warn-soft); border-color: transparent; }
.lb-callout.tone-important .lb-callout-ic { background: var(--warn); color: var(--surface); }
.lb-callout.tone-tip { background: var(--ok-soft); border-color: transparent; }
.lb-callout.tone-tip .lb-callout-ic { background: var(--ok); color: var(--surface); }
.lb-callout.tone-note .lb-callout-ic { background: var(--accent-soft); color: var(--accent-text); }

/* галерея: 2–3 в ряд, на телефоне 2 */
.lb-gallery { display: grid; gap: 10px; margin: 18px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lb-gallery.n1 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .lb-gallery.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lb-gallery figure { margin: 0; }
.lb-gallery a { display: block; }
.lb-gallery img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-l); background: var(--surface-2); }
.lb-gallery figcaption { font-size: 13px; color: var(--text-3); text-align: center; margin-top: 6px; }

/* «Закончили урок?» — в конце урока, рядом со «Следующий урок» */
.lesson-finish {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; padding: 16px 20px;
  border-radius: var(--r-l); border: 1px solid var(--border); background: var(--surface-2);
}
.lesson-finish .t { flex: 1; min-width: 200px; }
.lesson-finish .t b { display: block; font-weight: 600; }
.lesson-finish .t span { display: block; }
.lesson-finish.is-done { background: var(--ok-soft); border-color: transparent; }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lesson-nav .btn { height: auto; min-height: 44px; padding: 10px 16px; white-space: normal; text-align: left; max-width: 48%; }
.outline { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.outline .progress-label { margin-bottom: 6px; }

/* ---------- сертификаты ---------- */

.cert { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 760px) { .cert { grid-template-columns: 200px minmax(0, 1fr); } }
.cert-badge {
  aspect-ratio: 4 / 3; border-radius: var(--r-l); display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(135deg, var(--neutral-soft) 0 10px, var(--surface-2) 10px 20px);
  color: var(--text-3); font-weight: 600; padding: 12px; border: 1px solid var(--border);
}
.cert-badge.ready { background: radial-gradient(120% 140% at 100% 0%, #6b3a48 0%, #2b2522 55%, #1c1a17 100%); color: #fff; border-color: transparent; }

/* ---------- профиль и помощь ---------- */

.profile-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head .avatar { width: 52px; height: 52px; font-size: 18px; }
.profile-head b { display: block; font-size: 17px; }
.profile-grid .form { max-width: 440px; }
.profile-grid .form button { justify-self: start; }
.field-static { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.field-static div { height: 40px; display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); font-weight: 400; font-size: 15px; }
.help-list { display: grid; gap: 0; }
.faq { border-top: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-size: 20px; line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; }

/* ---------- знакомство с кабинетом (tour.js) ---------- */

.tour-blocker { position: fixed; inset: 0; z-index: 90; transition: background 0.35s ease; }
.tour-blocker.dim { background: rgba(15, 13, 12, 0.62); }
.tour-spot {
  position: fixed; z-index: 91; pointer-events: none; border-radius: var(--r-l);
  box-shadow: 0 0 0 9999px rgba(15, 13, 12, 0.62);
  transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}
.tour-spot::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent);
  animation: tour-pulse 1.8s ease-out infinite;
}
.tour-spot.empty { box-shadow: none; }
.tour-spot.empty::after { display: none; }
@keyframes tour-pulse {
  0% { opacity: 0.9; transform: scale(1); }
  70% { opacity: 0; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.04); }
}
.tour-card {
  position: fixed; z-index: 92; width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface); color: var(--text); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  padding: 16px 18px 16px; opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, top 0.35s ease, left 0.35s ease;
}
.tour-card.show { opacity: 1; transform: none; }
.tour-card.centered { top: 50% !important; left: 50% !important; transform: translate(-50%, calc(-50% + 8px)); width: 380px; text-align: center; padding: 26px 24px 20px; }
.tour-card.centered.show { transform: translate(-50%, -50%); }
.tour-card.centered .tour-head { justify-content: center; }
.tour-card.centered .tour-actions { justify-content: center; }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; min-height: 20px; }
.tour-count { font-size: 12px; font-weight: 600; color: var(--accent-text); letter-spacing: 0.02em; }
.tour-skip { height: auto; padding: 2px 4px; background: transparent; color: var(--text-3); font-size: 13px; font-weight: 400; border: 0; }
.tour-skip:hover { background: transparent; color: var(--text); text-decoration: underline; }
.tour-title { display: block; font-size: 17px; font-weight: 650; margin-bottom: 6px; letter-spacing: -0.01em; }
.tour-text { color: var(--text-2); font-size: 14.5px; line-height: 1.5; margin: 0 0 14px; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-card { transition: none; }
  .tour-spot::after { animation: none; }
}

/* ---------- телефон: шапка сверху, меню снизу ---------- */

.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto; overflow: visible;
    flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px;
    background: var(--app-bg); border-bottom: 1px solid var(--border);
  }
  .sidebar .brand { padding: 0; font-size: 14.5px; }
  .sidebar .brand img { width: 30px; height: 30px; }
  .sidebar .nav, .sidebar .sidebar-link, .sidebar .theme-switch { display: none; }
  .sidebar-footer { margin: 0 0 0 auto; padding: 0; }
  .me-link { padding: 4px; }
  .me-link .me-text { display: none; }
  .main-wrap { padding: 0; }
  .main { border: 0; border-radius: 0; min-height: calc(100vh - 47px); padding: 20px 16px 104px; }
  h1, .lesson-title { font-size: 22px; }
  .panel { padding: 18px 16px; }
  .panel.continue, .panel.course-head, .panel.course-tile { padding: 0; }
  .continue-body, .course-head .info, .course-head .side { padding: 18px 16px; }
  .lesson-text { padding: 20px 16px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .value { font-size: 21px; }
  .course-head .side { border-left: 0; border-top: 1px solid var(--border); }
  .lesson-nav .btn { max-width: 100%; flex: 1; }
  .outline { position: static; max-height: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: 11px; color: var(--text-3); font-weight: 500; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent-text); }
}
