.knowledge-student-list { margin-top: 32px; }
.knowledge-student-lesson { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.knowledge-student-lesson > div { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.knowledge-student-lesson p { margin: 6px 0 0; color: var(--text-soft); line-height: 1.6; }
.knowledge-student-lesson .knowledge-number { flex-shrink: 0; }
.knowledge-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.knowledge-tabs button { display: inline-flex; gap: 8px; align-items: center; padding: 12px 16px; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; }
.knowledge-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.knowledge-tabs svg { width: 18px; height: 18px; }
.knowledge-course-settings { display: grid; gap: 20px; grid-template-columns: minmax(220px,1fr) minmax(280px,2fr); border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.knowledge-course-settings form { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.knowledge-course-settings form .field { flex: 1 1 260px; }
.knowledge-course-settings .field { min-width: 0; margin: 0; }
.knowledge-course-settings select { width: 100%; }
.knowledge-course-settings .check-inline { min-height: 42px; margin: 0; }
.knowledge-catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 28px; align-items: start; }
.knowledge-lesson-list { min-width: 0; }
.knowledge-lesson { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: var(--surface); }
.knowledge-lesson summary { display: grid; grid-template-columns: 32px minmax(0,1fr) auto 18px; gap: 10px; align-items: center; cursor: pointer; padding: 14px; list-style: none; }
.knowledge-lesson summary::-webkit-details-marker { display: none; }
.knowledge-lesson summary strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.knowledge-lesson summary svg { width: 18px; height: 18px; }
.knowledge-lesson[open] summary svg { transform: rotate(180deg); }
.knowledge-number { display: grid; place-items: center; background: var(--cyan-soft); color: var(--cyan); width: 32px; height: 32px; border-radius: 4px; font-weight: 700; }
.knowledge-lesson-body { padding: 0 18px 18px; border-top: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.6; }
.knowledge-lesson-body > p { margin-top: 16px; }
.knowledge-lesson-body dt { font-weight: 650; font-size: 13px; }
.knowledge-lesson-body dd { margin: 4px 0 16px; color: var(--text-soft); font-size: 14px; }
.knowledge-examples { white-space: pre-wrap; }
.knowledge-issue { color: var(--amber); background: var(--amber-soft); padding: 10px 12px; font-size: 13px; }
.knowledge-lesson-body form { margin-top: 16px; }
.knowledge-approval { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.knowledge-preview { border-left: 1px solid var(--line); padding-left: 24px; min-width: 0; }
.knowledge-preview h3 { font-size: 18px; }
#knowledgePreviewResult { margin-top: 20px; }
.knowledge-answer { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; margin-top: 14px; }
.knowledge-sources { display: grid; gap: 10px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; font-size: 13px; }
.knowledge-sources a { color: var(--primary); overflow-wrap: anywhere; }
.knowledge-sources small, .knowledge-sources a span { display: block; color: var(--text-soft); margin-top: 3px; font-size: 11px; }
@media (max-width: 1100px) {
  .knowledge-course-settings, .knowledge-catalog-layout { grid-template-columns: minmax(0,1fr); }
  .knowledge-preview { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
}
@media (max-width: 600px) {
  .knowledge-lesson summary { grid-template-columns: 28px minmax(0,1fr) 18px; gap: 8px; padding: 12px; }
  .knowledge-lesson summary .status-badge { grid-column: 2; grid-row: 2; justify-self: start; }
  .knowledge-lesson summary svg { grid-column: 3; grid-row: 1; }
  .knowledge-tabs button { font-size: 13px; padding: 10px 8px; }
}
:root {
  color-scheme: light;
  --bg: #f6f4fb;
  --surface: #ffffff;
  --surface-2: #f1ecf9;
  --surface-3: #e6ddf3;
  --text: #202229;
  --text-soft: #60616b;
  --line: #e1dcef;
  --primary: #7c2d91;
  --primary-strong: #641f78;
  --primary-soft: #f0e4f5;
  --cyan: #2e90d1;
  --cyan-soft: #e3f0fa;
  --coral: #d6473c;
  --coral-soft: #fbe7e4;
  --amber: #a66b00;
  --amber-soft: #fff0cc;
  --shadow: 0 14px 36px rgba(52, 25, 74, .10);
  --shadow-soft: 0 5px 18px rgba(52, 25, 74, .08);
  --sidebar: 258px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17131d;
  --surface: #201a29;
  --surface-2: #281f33;
  --surface-3: #33283f;
  --text: #f3f0f7;
  --text-soft: #b3aac2;
  --line: #3a2f48;
  --primary: #c58ad6;
  --primary-strong: #d7a6e6;
  --primary-soft: #37243f;
  --cyan: #6cb8e8;
  --cyan-soft: #1b3244;
  --coral: #f08a75;
  --coral-soft: #412720;
  --amber: #e5b654;
  --amber-soft: #3b3019;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
button, input, textarea, select { min-width: 0; font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { letter-spacing: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-soft); }
.eyebrow, .page-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 20px; height: 20px; }
.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 15px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .btn.primary { color: #2a1132; }
.btn.primary:hover { background: var(--primary-strong); }
.btn.soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn.danger { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.btn.wide { width: 100%; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn:disabled, .icon-btn:disabled { opacity: .5; cursor: wait; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(390px, .85fr); }
.auth-visual { position: relative; min-height: 100vh; overflow: hidden; color: #fff; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(24, 10, 28, .12), rgba(30, 10, 36, .82)); }
.auth-visual > img, .auth-visual > picture > img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.auth-brand, .mobile-brand, .brand { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 20px; }
.auth-brand { position: absolute; z-index: 1; left: 48px; top: 42px; }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 900; }
[data-theme="dark"] .brand-mark { color: #2a1132; }
.auth-message { position: absolute; z-index: 1; left: clamp(36px, 6vw, 84px); bottom: clamp(54px, 10vh, 110px); max-width: 620px; }
.auth-message .eyebrow { color: #a8ebd8; }
.auth-message h1 { margin: 14px 0 20px; font-size: clamp(42px, 5.4vw, 74px); line-height: 1.02; font-weight: 820; }
.auth-message p { max-width: 540px; margin: 0; font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.82); }
.auth-form-wrap { position: relative; min-width: 0; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 50px clamp(28px, 6vw, 88px); }
.theme-auth { position: absolute; top: 28px; right: 28px; }
.auth-form { width: min(100%, 430px); min-width: 0; max-width: 100%; }
.mobile-brand { display: none; margin-bottom: 56px; }
.auth-form h2 { margin: 10px 0 10px; font-size: 34px; }
.auth-form > .muted { margin-bottom: 34px; line-height: 1.55; }
.field { display: grid; gap: 8px; margin: 18px 0; color: var(--text-soft); font-size: 13px; font-weight: 750; }
.field input, .field textarea, .field select, .text-input, .select-input, .textarea-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea, .textarea-input { min-height: 100px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus, .text-input:focus, .select-input:focus, .textarea-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.input-icon { position: relative; display: block; }
.input-icon svg { position: absolute; left: 13px; top: 13px; width: 18px; color: var(--text-soft); }
.input-icon input { padding-left: 42px; }
.form-error { min-height: 22px; margin: -3px 0 10px; color: var(--coral); font-size: 13px; }
.auth-note { margin: 20px 0 0; display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--text-soft); font-size: 12px; }
.auth-note svg { width: 16px; }
.auth-link { width: 100%; margin-top: 13px; border: 0; background: transparent; color: var(--primary); font-weight: 750; cursor: pointer; }
.auth-link:hover { color: var(--primary-strong); }
.field-hint { color: var(--text-soft); font-size: 11px; font-weight: 550; line-height: 1.45; }
.notice { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.notice > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--text-soft); }
.notice > span svg { width: 18px; }
.notice strong, .notice small { display: block; }
.notice small { margin-top: 3px; color: var(--text-soft); line-height: 1.4; }
.notice.warning { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: var(--amber-soft); }
.notice.warning > span { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); color: var(--amber); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-head { height: 78px; flex: 0 0 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 21px; border-bottom: 1px solid var(--line); }
.sidebar-close { display: none; }
.nav-list { display: grid; gap: 4px; padding: 24px 14px; overflow-y: auto; }
.nav-btn { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 7px; padding: 10px 12px; background: transparent; color: var(--text-soft); text-align: left; font-weight: 700; cursor: pointer; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }
.nav-btn svg { width: 19px; height: 19px; }
.nav-label { margin: 18px 12px 5px; color: var(--text-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.sidebar-bottom { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.assistant-mini { width: 100%; display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 10px; border: 0; border-radius: 8px; padding: 11px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; }
.assistant-mini:hover { background: var(--primary-soft); }
.assistant-mini > svg { width: 17px; color: var(--text-soft); }
.assistant-mini strong, .assistant-mini small { display: block; }
.assistant-mini strong { font-size: 13px; }
.assistant-mini small { margin-top: 2px; color: var(--text-soft); font-size: 11px; }
.assistant-orbit { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; }
[data-theme="dark"] .assistant-orbit { color: #2a1132; }
.assistant-orbit svg { width: 18px; }
.profile-mini { margin-top: 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--cyan-soft); color: var(--cyan); font-weight: 850; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong, .profile-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { margin-top: 2px; color: var(--text-soft); font-size: 11px; }
.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 20; top: 0; height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(20px, 3.4vw, 50px); background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.15; }
.topbar-actions { display: flex; align-items: center; gap: 5px; }
.menu-btn { display: none; }
.notification-btn { position: relative; }
.notification-btn span { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); border: 2px solid var(--bg); }
.top-profile { display: flex; align-items: center; gap: 9px; margin-left: 6px; padding: 4px 6px 4px 4px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 700; }
.top-profile:hover { background: var(--surface-2); }
.top-profile > svg { width: 16px; color: var(--text-soft); }
.page-content { width: min(1440px, 100%); margin: 0 auto; padding: 34px clamp(20px, 3.4vw, 50px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.page-head h2 { margin-bottom: 7px; font-size: 26px; }
.page-head p { margin: 0; color: var(--text-soft); line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 34px 0 16px; }
.section-title h2, .section-title h3 { margin: 0; font-size: 19px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); }
.stat-icon.cyan { color: var(--cyan); background: var(--cyan-soft); }
.stat-icon.coral { color: var(--coral); background: var(--coral-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon svg { width: 19px; }
.stat-value { margin: 20px 0 3px; font-size: 30px; font-weight: 850; }
.stat-label { color: var(--text-soft); font-size: 13px; }
.trend { font-size: 11px; color: var(--primary); font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; margin-top: 18px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 17px; }
.panel-head p { margin: 4px 0 0; color: var(--text-soft); font-size: 12px; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--primary); }
.activity-icon svg { width: 17px; }
.activity-main { min-width: 0; }
.activity-main strong, .activity-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-main strong { font-size: 13px; }
.activity-main small { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.score { min-width: 48px; padding: 6px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 850; text-align: center; }
.score.low { background: var(--coral-soft); color: var(--coral); }
.course-mini-list { display: grid; gap: 14px; }
.course-mini { display: grid; grid-template-columns: 46px 1fr auto; gap: 11px; align-items: center; }
.course-mini-cover { width: 46px; height: 46px; border-radius: 7px; object-fit: cover; background: var(--surface-2); }
.course-mini strong, .course-mini small { display: block; }
.course-mini strong { font-size: 13px; }
.course-mini small { margin-top: 3px; color: var(--text-soft); font-size: 11px; }
.course-mini > span:last-child { color: var(--text-soft); font-size: 12px; }

.courses-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.course-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.course-cover { position: relative; aspect-ratio: 16 / 8.8; overflow: hidden; background: var(--surface-2); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.course-card:hover .course-cover img { transform: scale(1.025); }
.course-cover .status-badge { position: absolute; top: 12px; left: 12px; }
.course-body { padding: 18px; }
.course-body h3 { margin-bottom: 8px; font-size: 17px; }
.course-body p { min-height: 42px; margin-bottom: 16px; color: var(--text-soft); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-soft); font-size: 11px; }
.course-meta span { display: flex; align-items: center; gap: 5px; }
.course-meta svg { width: 14px; }
.course-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; width: max-content; border-radius: 5px; padding: 5px 8px; background: var(--surface-2); color: var(--text-soft); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.status-badge.published, .status-badge.completed { background: var(--primary-soft); color: var(--primary); }
.status-badge.draft { background: var(--amber-soft); color: var(--amber); }
.status-badge.archived { background: var(--surface-3); color: var(--text-soft); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.search-box { position: relative; width: min(360px, 100%); }
.search-box svg { position: absolute; left: 12px; top: 12px; width: 18px; color: var(--text-soft); }
.search-box input { padding-left: 39px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th { padding: 12px 16px; background: var(--surface-2); color: var(--text-soft); font-size: 10px; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table-person { display: flex; align-items: center; gap: 10px; }
.table-person strong, .table-person small { display: block; }
.table-person small { margin-top: 3px; color: var(--text-soft); font-size: 11px; }
.user-cell { display: flex; min-width: 0; align-items: center; gap: 12px; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { line-height: 1.35; overflow-wrap: anywhere; }
.user-copy small { margin-top: 3px; color: var(--text-soft); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; }
.students-table { min-width: 940px; }
.course-cell { max-width: 210px; }
.course-cell strong, .course-cell small { display: block; }
.course-cell small { margin-top: 3px; overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.check-list { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.course-check { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: center; padding: 13px 14px; cursor: pointer; }
.course-check + .course-check { border-top: 1px solid var(--line); }
.course-check:hover { background: var(--surface-2); }
.course-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.course-check strong, .course-check small { display: block; }
.course-check small { margin-top: 3px; color: var(--text-soft); font-size: 11px; }
.success-summary { padding: 6px 8px 20px; text-align: center; }
.success-summary > span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.success-summary > span svg { width: 25px; }
.success-summary h3 { margin-bottom: 7px; }
.success-summary p { max-width: 440px; margin: auto; color: var(--text-soft); line-height: 1.55; }
.credentials { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.credentials > div { padding: 12px 14px; }
.credentials > div + div { border-top: 1px solid var(--line); }
.credentials small, .credentials strong { display: block; }
.credentials small { margin-bottom: 4px; color: var(--text-soft); font-size: 10px; text-transform: uppercase; }
.empty-state.compact { padding: 24px 12px; }

.builder-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.builder-nav { position: sticky; top: 98px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.builder-nav-head { padding: 6px 7px 12px; border-bottom: 1px solid var(--line); }
.builder-nav-head strong, .builder-nav-head small { display: block; }
.builder-nav-head small { margin-top: 4px; color: var(--text-soft); }
.lesson-nav { display: grid; gap: 4px; margin-top: 10px; }
.lesson-nav button { width: 100%; display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text-soft); text-align: left; cursor: pointer; }
.lesson-nav button:hover, .lesson-nav button.active { background: var(--primary-soft); color: var(--primary); }
.lesson-no { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); font-size: 11px; font-weight: 850; }
.lesson-nav button.active .lesson-no { background: var(--primary); color: #fff; }
.builder-main { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.color-field { display: flex; gap: 8px; }
.color-field input[type="color"] { width: 48px; padding: 4px; }
.material-list { display: grid; gap: 8px; }
.material-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.material-row > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: var(--cyan-soft); color: var(--cyan); }
.material-row svg { width: 17px; }
.material-row strong, .material-row small { display: block; }
.material-row small { color: var(--text-soft); font-size: 11px; }
.question-builder { margin-top: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.question-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.question-head strong { font-size: 13px; }
.options-editor { display: grid; gap: 8px; }
.option-edit { display: grid; grid-template-columns: 24px 1fr 36px; align-items: center; gap: 7px; }
.option-edit input[type="radio"], .option-edit input[type="checkbox"] { accent-color: var(--primary); }
.empty-state { padding: 52px 20px; text-align: center; color: var(--text-soft); }
.empty-state span { width: 54px; height: 54px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--primary); }
.empty-state svg { width: 25px; }
.empty-state h3 { margin-bottom: 7px; color: var(--text); }
.empty-state p { max-width: 440px; margin: 0 auto 16px; line-height: 1.55; }

.student-welcome { position: relative; min-height: 250px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .62fr); overflow: hidden; border-radius: 8px; background: #3f1249; color: #fff; }
.welcome-copy { position: relative; z-index: 2; padding: clamp(28px, 4vw, 48px); align-self: center; }
.welcome-copy .eyebrow { color: #dcb2e8; }
.welcome-copy h2 { margin: 10px 0 12px; max-width: 650px; font-size: clamp(28px, 3.2vw, 43px); line-height: 1.1; }
.welcome-copy p { max-width: 600px; margin-bottom: 22px; color: rgba(255,255,255,.72); line-height: 1.6; }
.welcome-copy .btn { border-color: #fff; background: #fff; color: #3f1249; }
.welcome-photo { position: relative; min-height: 250px; }
.welcome-photo::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, #3f1249 0%, transparent 70%); }
.welcome-photo img { width: 100%; height: 100%; object-fit: cover; }
.progress-line { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.student-course-card .course-actions { display: grid; grid-template-columns: 1fr auto; }
.progress-copy { font-size: 11px; color: var(--text-soft); }
.progress-copy strong { color: var(--text); }
.lesson-list { display: grid; gap: 10px; }
.lesson-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.lesson-row:hover { border-color: var(--primary); }
.lesson-index { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-soft); font-weight: 850; }
.lesson-row.completed .lesson-index { background: var(--primary-soft); color: var(--primary); }
.lesson-copy { min-width: 0; }
.lesson-copy strong, .lesson-copy small { display: block; }
.lesson-copy small { margin-top: 4px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-side { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 12px; }
.lesson-content { white-space: pre-line; line-height: 1.8; color: color-mix(in srgb, var(--text) 88%, var(--text-soft)); }
.media-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.media-item { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.media-item img, .media-item video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.media-info { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; }
.quiz-shell { display: grid; gap: 16px; }
.quiz-question { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.quiz-question h4 { margin-bottom: 14px; font-size: 15px; line-height: 1.5; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.quiz-option:hover { border-color: var(--primary); }
.quiz-option input { margin-top: 3px; accent-color: var(--primary); }
.result-banner { display: grid; grid-template-columns: 70px 1fr; gap: 18px; align-items: center; padding: 22px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.result-banner.failed { background: var(--coral-soft); color: var(--coral); }
.result-score { width: 68px; height: 68px; display: grid; place-items: center; border: 5px solid currentColor; border-radius: 50%; font-size: 17px; font-weight: 900; }
.result-banner h3 { margin-bottom: 5px; }
.result-banner p { margin: 0; color: var(--text-soft); }

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.news-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.news-card.featured { grid-column: span 2; }
.news-image { aspect-ratio: 16 / 8; background: var(--surface-2); }
.news-image img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 18px; }
.news-top { display: flex; justify-content: space-between; gap: 10px; color: var(--text-soft); font-size: 11px; }
.news-body h3 { margin: 10px 0 8px; font-size: 17px; }
.news-body p { margin-bottom: 0; color: var(--text-soft); line-height: 1.6; white-space: pre-line; }
.pin { display: inline-flex; gap: 4px; align-items: center; color: var(--coral); font-weight: 800; }
.pin svg { width: 13px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider-option { position: relative; display: block; }
.provider-option input { position: absolute; opacity: 0; }
.provider-card { min-height: 100px; display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: start; padding: 15px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.provider-option input:checked + .provider-card { border-color: var(--primary); background: var(--primary-soft); }
.provider-logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--primary); font-weight: 900; }
.provider-card strong, .provider-card small { display: block; }
.provider-card small { margin-top: 5px; color: var(--text-soft); line-height: 1.4; }
.config-status { display: flex; align-items: center; gap: 8px; padding: 11px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 750; }
.config-status.missing { background: var(--amber-soft); color: var(--amber); }
.config-status svg { width: 17px; }

.assistant-drawer { position: fixed; z-index: 50; top: 0; right: 0; width: min(440px, 100vw); height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -20px 0 50px rgba(0,0,0,.12); transform: translateX(102%); transition: transform .25s ease; }
.assistant-drawer.open { transform: translateX(0); }
.assistant-head { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.assistant-head > div { display: flex; align-items: center; gap: 11px; }
.assistant-head strong, .assistant-head small { display: block; }
.assistant-head small { margin-top: 3px; color: var(--text-soft); font-size: 11px; }
.assistant-suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 12px 15px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.suggestion { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: var(--surface); color: var(--text-soft); font-size: 11px; cursor: pointer; }
.suggestion:hover { border-color: var(--primary); color: var(--primary); }
.chat-messages { overflow-y: auto; padding: 20px 16px; }
.chat-welcome { padding: 22px 8px 30px; text-align: center; color: var(--text-soft); }
.chat-welcome .assistant-orbit { width: 52px; height: 52px; margin-bottom: 13px; }
.chat-welcome h3 { margin-bottom: 7px; color: var(--text); }
.chat-welcome p { margin: 0; line-height: 1.55; }
.message { max-width: 88%; margin: 10px 0; }
.message.user { margin-left: auto; }
.message-bubble { padding: 11px 13px; border-radius: 8px; background: var(--surface-2); line-height: 1.55; white-space: pre-line; }
.message.user .message-bubble { background: var(--primary); color: #fff; }
[data-theme="dark"] .message.user .message-bubble { color: #2a1132; }
.message-meta { margin-top: 4px; color: var(--text-soft); font-size: 10px; }
.message.user .message-meta { text-align: right; }
.speak-btn { width: 27px; height: 27px; min-width: 27px; vertical-align: middle; }
.speak-btn svg { width: 14px; height: 14px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 15px; border-radius: 8px; background: var(--surface-2); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-soft); animation: pulse 1s infinite alternate; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-3px); } }
.chat-composer { display: grid; grid-template-columns: 40px 1fr 40px; gap: 7px; align-items: end; padding: 13px; border-top: 1px solid var(--line); }
.chat-composer textarea { width: 100%; max-height: 120px; min-height: 40px; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--bg); color: var(--text); outline: none; line-height: 1.45; }
.chat-composer textarea:focus { border-color: var(--primary); }
.send-btn { background: var(--primary); color: #fff; }
.send-btn:hover { background: var(--primary-strong); color: #fff; }
.mic-btn.listening { background: var(--coral-soft); color: var(--coral); animation: mic 1s infinite alternate; }
@keyframes mic { to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--coral) 10%, transparent); } }
.drawer-scrim, .sidebar-scrim { position: fixed; z-index: 40; inset: 0; background: rgba(10, 18, 15, .4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.drawer-scrim.open, .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
.sidebar-scrim { z-index: 25; }

.modal-root { position: fixed; z-index: 80; inset: 0; pointer-events: none; }
.modal-root.open { pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8, 16, 13, .55); backdrop-filter: blur(4px); }
.modal { width: min(620px, 100%); max-height: min(780px, 92vh); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.modal.wide { width: min(900px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px; border-top: 1px solid var(--line); }
.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in .22s ease; }
.toast svg { width: 19px; color: var(--primary); }
.toast.error svg { color: var(--coral); }
.toast strong, .toast small { display: block; }
.toast small { margin-top: 3px; color: var(--text-soft); line-height: 1.4; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.skeleton { position: relative; overflow: hidden; min-height: 100px; border-radius: 8px; background: var(--surface-2); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 75%, transparent), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Cabinet-specific surfaces */
.skeleton.tall { min-height: 330px; }
.stat-value.compact { overflow: hidden; font-size: 20px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.setup-steps { display: grid; }
.setup-row { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) 22px; gap: 12px; align-items: center; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.setup-row:last-child { border-bottom: 0; }
.setup-row > svg { width: 17px; color: var(--text-soft); }
.setup-row strong, .setup-row small { display: block; }
.setup-row small { margin-top: 4px; color: var(--text-soft); }
.setup-number { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text-soft); font-weight: 850; }
.setup-number.done { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.setup-number svg { width: 16px; }
.flow-stack { display: grid; justify-items: center; gap: 8px; padding: 4px 0; }
.flow-stack > div { width: 100%; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.flow-stack > div > svg { width: 21px; color: var(--primary); }
.flow-stack > svg { width: 18px; color: var(--text-soft); }
.flow-stack strong, .flow-stack small { display: block; }
.flow-stack small { margin-top: 3px; color: var(--text-soft); }
.toolbar .input-icon.search { width: min(430px, 100%); }
.toolbar .input-icon.search input { width: 100%; }
.empty-inline { padding: 28px; color: var(--text-soft); text-align: center; }
.info-list { display: grid; gap: 0; margin-top: 18px; }
.info-list > div { display: grid; gap: 5px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-list > div:last-child { border: 0; }
.info-list span { color: var(--text-soft); font-size: 11px; }
.info-list strong { overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.provider-list { display: grid; gap: 9px; }
.provider-row { display: grid; grid-template-columns: 46px minmax(180px, 1fr) minmax(130px, auto) auto 20px; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; }
.provider-row.default { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.provider-row:hover { border-color: var(--primary); }
.provider-row > svg { width: 17px; color: var(--text-soft); }
.provider-main { min-width: 0; }
.provider-main > span { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.provider-main strong, .provider-main small { display: block; }
.provider-main small { margin-top: 5px; overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; }
.provider-health { display: inline-flex; align-items: center; gap: 6px; color: var(--amber); font-size: 11px; font-weight: 750; }
.provider-health.ready { color: var(--primary); }
.provider-health svg { width: 15px; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 17px; }
.check-row label { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.check-row input { accent-color: var(--primary); }
.event-list { display: grid; gap: 10px; }
.event-card { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 17px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); }
.event-date { width: 62px; height: 62px; display: grid; place-content: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary); text-align: center; }
.event-date strong { font-size: 23px; line-height: 1; }
.event-date span { margin-top: 4px; font-size: 10px; text-transform: uppercase; }
.event-copy h3 { margin: 5px 0; font-size: 16px; }
.event-copy p { margin: 0; color: var(--text-soft); line-height: 1.5; }
.event-actions { display: flex; align-items: center; gap: 7px; }
.icon-btn.danger { color: var(--coral); }
.cabinet-welcome { grid-template-columns: minmax(0, 1fr) minmax(220px, .45fr); }
.progress-hero { display: grid; place-items: center; min-height: 250px; background: #6d2a80; }
.progress-ring { --progress: 0; width: 160px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#8fe2c8 calc(var(--progress) * 1%), rgba(255,255,255,.16) 0); }
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 125px; aspect-ratio: 1; border-radius: 50%; background: #6d2a80; }
.progress-ring span { z-index: 1; grid-area: 1 / 1; text-align: center; }
.progress-ring strong, .progress-ring small { display: block; }
.progress-ring strong { font-size: 31px; }
.progress-ring small { margin-top: 4px; color: rgba(255,255,255,.7); }
.cabinet-courses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.progress-card .course-body { min-height: 165px; display: flex; flex-direction: column; }
.progress-card .progress-line { margin-top: auto; }
.student-lower { margin-top: 24px; }
.student-lower .event-card { grid-template-columns: 58px minmax(0, 1fr); padding: 0; border: 0; box-shadow: none; }
.student-lower .event-actions { grid-column: 2; }
.assistant-promo { text-align: center; }
.assistant-promo .assistant-orbit { margin: 0 auto 14px; }
.assistant-promo p { color: var(--text-soft); line-height: 1.6; }
.assistant-page { min-height: 520px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .55fr); gap: 22px; align-items: stretch; }
.assistant-page > section, .assistant-page > aside { padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.assistant-page h2 { margin: 12px 0; font-size: 32px; }
.assistant-page p { max-width: 680px; color: var(--text-soft); line-height: 1.65; }
.assistant-page > aside { display: flex; flex-direction: column; justify-content: center; background: #23384a; color: #fff; }
.assistant-page > aside > svg { width: 38px; height: 38px; margin-bottom: 20px; color: #79d9c2; }
.assistant-page > aside p { color: rgba(255,255,255,.7); }
.assistant-orbit.large { width: 58px; height: 58px; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 24px 0; }
.prompt-card { min-height: 110px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; }
.prompt-card:hover { border-color: var(--primary); }
.prompt-card svg { width: 19px; color: var(--primary); }
.profile-summary { padding: 20px 0; text-align: center; }
.profile-summary .avatar.large { width: 70px; height: 70px; margin: 0 auto 14px; font-size: 20px; }
.profile-summary h3 { margin-bottom: 6px; }
.profile-summary p { color: var(--text-soft); }
.invite-person { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 13px; border-radius: 8px; background: var(--surface-2); }
.invite-person strong, .invite-person small { display: block; }
.invite-person small { margin-top: 3px; color: var(--text-soft); }
.assistant-suggestions > button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: var(--surface); color: var(--text-soft); font-size: 11px; cursor: pointer; }
.assistant-suggestions > button:hover, .assistant-suggestions > button.active { border-color: var(--primary); color: var(--primary); }
.assistant-suggestions > button svg { width: 14px; }
.chat-bubble { max-width: 86%; margin: 10px 0; padding: 11px 13px; border-radius: 8px; background: var(--surface-2); line-height: 1.55; }
.chat-bubble.user { margin-left: auto; background: var(--primary); color: #fff; }
.chat-bubble small { display: block; margin-top: 5px; color: var(--text-soft); font-size: 9px; }
.chat-bubble.user small { color: rgba(255,255,255,.7); text-align: right; }
.chat-bubble.typing { display: flex; gap: 4px; width: max-content; }
.chat-bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-soft); animation: pulse 1s infinite alternate; }
.chat-bubble.typing i:nth-child(2) { animation-delay: .2s; }
.chat-bubble.typing i:nth-child(3) { animation-delay: .4s; }
.empty-state.large { min-height: 460px; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .courses-grid, .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cabinet-courses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-card.featured { grid-column: span 1; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .mobile-brand { display: flex; }
  .auth-form-wrap { padding-top: 34px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-btn { display: inline-grid; }
  .main-shell { margin-left: 0; }
  .dashboard-grid, .settings-layout { grid-template-columns: 1fr; }
  .assistant-page { grid-template-columns: 1fr; }
  .builder-layout { grid-template-columns: 1fr; }
  .builder-nav { position: static; }
  .lesson-nav { display: flex; overflow-x: auto; }
  .lesson-nav button { min-width: 210px; }
}

@media (max-width: 680px) {
  .topbar { height: 68px; padding: 0 14px; }
  .page-content { padding: 23px 14px 55px; }
  .page-kicker, .top-profile > span:not(.avatar), .top-profile > svg { display: none; }
  .topbar h1 { font-size: 19px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions .btn { flex: 1; }
  .stats-grid, .courses-grid, .news-grid, .provider-grid, .form-grid, .media-gallery { grid-template-columns: 1fr; }
  .cabinet-courses, .prompt-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .student-welcome { grid-template-columns: 1fr; }
  .cabinet-welcome { grid-template-columns: 1fr; }
  .progress-hero { min-height: 210px; }
  .provider-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .provider-health { grid-column: 2; }
  .provider-row .btn { grid-column: 2; justify-self: start; }
  .provider-row > svg { grid-column: 3; grid-row: 1; }
  .event-card { grid-template-columns: 58px minmax(0, 1fr); }
  .event-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .welcome-photo { position: absolute; inset: 0; opacity: .32; }
  .welcome-photo::before { background: rgba(21, 53, 45, .35); }
  .welcome-copy { min-height: 280px; display: flex; flex-direction: column; justify-content: center; }
  .course-card { width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .students-wrap { overflow: visible; border: 0; background: transparent; }
  .students-table, .students-table tbody, .students-table tr, .students-table td { display: block; width: 100%; min-width: 0; }
  .students-table thead { display: none; }
  .students-table tbody { display: grid; gap: 10px; }
  .students-table tr { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
  .students-table td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 14px; border-top: 1px solid var(--line); }
  .students-table td::before { content: attr(data-label); color: var(--text-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .students-table .student-identity { display: block; padding: 16px 14px; border-top: 0; }
  .students-table .student-identity::before, .students-table .student-actions::before { display: none; }
  .students-table .student-actions { display: block; padding-top: 12px; }
  .students-table .table-actions { justify-content: stretch; }
  .students-table .table-actions .btn { flex: 1; }
  .students-table .status-badge { max-width: 100%; overflow-wrap: anywhere; }
  .students-table .course-cell { max-width: none; }
  .students-table .course-cell small { white-space: normal; }
  .lesson-row { grid-template-columns: 40px minmax(0, 1fr); }
  .lesson-side { grid-column: 2; justify-content: space-between; }
  .activity-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .result-banner { grid-template-columns: 1fr; text-align: center; }
  .result-score { margin: auto; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 8px 8px 0 0; }
  .auth-form-wrap { padding-left: 22px; padding-right: 22px; }
  .auth-form { width: 100%; }
  .auth-form h2 { font-size: 29px; }
  .notice { grid-template-columns: 36px minmax(0, 1fr); }
  .notice .btn { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Embedded tools keep the legacy admin shell and only render the work surface. */
html.embed-mode {
  color-scheme: light;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f0f1f7;
  --surface-3: #e7e8f1;
  --text: #202342;
  --text-soft: #6f7488;
  --line: #dfe2ed;
  --primary: #6b5ac7;
  --primary-strong: #5747b5;
  --primary-soft: #ece9fb;
  --cyan: #348fc7;
  --cyan-soft: #e4f2fa;
  --coral: #d65f4a;
  --coral-soft: #fbe7e2;
  --amber: #9a6907;
  --amber-soft: #fff0cc;
  --shadow: 0 14px 36px rgba(35, 38, 70, .09);
  --shadow-soft: 0 5px 18px rgba(35, 38, 70, .06);
}

html.embed-mode .sidebar,
html.embed-mode .topbar,
html.embed-mode .sidebar-scrim,
html.embed-mode .assistant-drawer,
html.embed-mode .drawer-scrim {
  display: none !important;
}

html.embed-mode .main-shell {
  min-height: 100vh;
  margin-left: 0;
}

html.embed-mode .page-content {
  width: 100%;
  max-width: none;
  padding: 26px;
}

html.embed-mode .page-head {
  min-height: 42px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 18px;
}

html.embed-mode .page-head > div:first-child {
  display: none;
}

html.embed-mode .auth-shell {
  min-height: 100vh;
  grid-template-columns: 1fr;
}

html.embed-mode .auth-visual { display: none; }
html.embed-mode .auth-form-wrap { min-height: 100vh; padding: 24px; }

.course-builder-shell {
  display: grid;
  grid-template-columns: 245px 280px minmax(430px, 1fr);
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.builder-column {
  min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.builder-course-column { background: var(--surface-2); }

.builder-column-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}

.builder-column-head > span { min-width: 0; }
.builder-column-head strong, .builder-column-head small { display: block; }
.builder-column-head strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.builder-column-head small { margin-top: 4px; color: var(--text-soft); font-size: 10px; }

.builder-course-list,
.builder-lesson-list {
  max-height: 610px;
  overflow-y: auto;
  padding: 8px;
}

.builder-module {
  margin-bottom: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.builder-module.active { border-color: color-mix(in srgb, var(--primary) 42%, var(--line)); }

.builder-module-head {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.builder-module-head > button:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.builder-module-head > button:first-child > svg { width: 16px; color: var(--primary); }
.builder-module-head strong, .builder-module-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-module-head strong { font-size: 11px; }
.builder-module-head small { margin-top: 2px; color: var(--text-soft); font-size: 9px; }
.builder-module-lessons { padding: 4px; }
.builder-module-empty { padding: 14px 8px; color: var(--text-soft); font-size: 10px; text-align: center; }

.builder-course-item,
.builder-lesson-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.builder-course-item { grid-template-columns: 4px minmax(0, 1fr) 16px; padding: 8px 9px; }
.builder-lesson-item { grid-template-columns: 30px minmax(0, 1fr); padding: 8px; }

.builder-course-item:hover,
.builder-course-item.active,
.builder-lesson-item:hover,
.builder-lesson-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.builder-course-item strong,
.builder-course-item small,
.builder-lesson-item strong,
.builder-lesson-item small { display: block; }

.builder-course-item strong,
.builder-lesson-item strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-course-item small,
.builder-lesson-item small { margin-top: 4px; color: var(--text-soft); font-size: 10px; }
.builder-course-item > svg { width: 14px; }
.builder-course-accent { width: 4px; height: 34px; border-radius: 3px; }
.builder-lesson-item .lesson-no { width: 28px; height: 28px; }

.builder-add-row {
  width: calc(100% - 16px);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 3px 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.builder-add-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.builder-add-row svg { width: 15px; }
.builder-add-row.compact { width: calc(100% - 8px); height: 34px; margin: 0 4px 5px; font-size: 10px; }

.builder-column-empty {
  min-height: 170px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 18px;
  color: var(--text-soft);
  text-align: center;
}

.builder-column-empty > svg { width: 25px; color: var(--primary); }
.builder-column-empty strong { font-size: 12px; }
.builder-column-empty small { max-width: 170px; font-size: 10px; line-height: 1.45; }
.builder-editor-column { min-width: 0; background: var(--surface); }

.builder-welcome {
  min-height: 680px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  text-align: center;
}

.builder-welcome > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.builder-welcome h3 { margin: 0 0 8px; font-size: 19px; }
.builder-welcome p { max-width: 430px; margin: 0 0 20px; color: var(--text-soft); font-size: 13px; line-height: 1.6; }
.builder-editor { min-width: 0; }

.builder-editor-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}

.builder-editor-head h3 { margin: 3px 0 0; font-size: 16px; }

.builder-block-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.builder-block-toolbar > span { margin-right: 4px; color: var(--text-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }

.builder-block-toolbar button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.builder-block-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.builder-block-toolbar svg { width: 14px; }
.builder-editor-fields { padding: 19px 20px 5px; }
.lesson-content-editor { min-height: 280px; resize: vertical; line-height: 1.65; }
.builder-materials { padding: 12px 20px 20px; border-top: 1px solid var(--line); }
.builder-section-title { margin-bottom: 11px; }
.builder-section-title.builder-tests-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.builder-section-title strong, .builder-section-title small { display: block; }
.builder-section-title strong { font-size: 13px; }
.builder-section-title small { margin-top: 3px; color: var(--text-soft); font-size: 10px; }
.builder-materials .material-row { text-decoration: none; }

.builder-inline-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 11px;
  text-align: center;
}

.builder-quiz-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 11px 12px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.builder-quiz-summary > svg { width: 20px; }
.builder-quiz-summary > span { min-width: 0; flex: 1; }
.builder-quiz-summary > div { display: flex; align-items: center; gap: 4px; }
.builder-quiz-summary strong, .builder-quiz-summary small { display: block; }
.builder-quiz-summary strong { font-size: 12px; }
.builder-quiz-summary small { margin-top: 3px; color: var(--text-soft); font-size: 10px; }

.builder-savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.builder-savebar > span { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 10px; }
.builder-savebar > span svg { width: 15px; }
.quiz-option-editor { display: grid; gap: 8px; }
.quiz-option-editor label { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 7px; }
.quiz-option-editor input[type="radio"] { width: 17px; height: 17px; accent-color: var(--primary); }

.builder-question-editor {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.builder-question-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.builder-question-editor > header strong { font-size: 12px; }
.builder-add-question { width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px dashed var(--line); border-radius: 6px; background: transparent; color: var(--primary); cursor: pointer; font-size: 11px; font-weight: 800; }
.builder-add-question:hover { border-color: var(--primary); background: var(--primary-soft); }
.builder-add-question svg { width: 15px; }

@media (max-width: 1240px) {
  .course-builder-shell { grid-template-columns: 230px minmax(280px, 1fr); }
  .builder-editor-column { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .builder-welcome { min-height: 430px; }
}

@media (max-width: 720px) {
  html.embed-mode .page-content { padding: 14px; }
  html.embed-mode .page-head { min-height: 40px; align-items: center; }
  .course-builder-shell { display: block; }
  .builder-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .builder-course-list, .builder-lesson-list { max-height: 240px; }
  .builder-editor-column { border-top: 0; }
  .builder-block-toolbar { overflow-x: auto; }
  .builder-block-toolbar > span { display: none; }
  .builder-block-toolbar button { flex: 0 0 auto; }
  .builder-editor-head, .builder-editor-fields, .builder-materials, .builder-savebar { padding-left: 14px; padding-right: 14px; }
  .builder-savebar > span { display: none; }
  .builder-savebar { justify-content: flex-end; }
}

.section-tabs {
  width: fit-content;
  max-width: 100%;
  display: flex;
  gap: 4px;
  margin: -4px 0 18px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.section-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.section-tab svg { width: 17px; }
.section-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-soft); }
.password-editor { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 7px; }
.password-editor .icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); }

.support-launcher {
  position: fixed;
  z-index: 44;
  right: 24px;
  bottom: 24px;
  min-width: 190px;
  height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(23, 40, 33, .18);
  text-align: left;
  cursor: pointer;
}

.support-launcher-icon,
.support-head-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
}

.support-launcher-icon svg, .support-head-icon svg { width: 20px; }
.support-launcher strong, .support-launcher small { display: block; }
.support-launcher strong { font-size: 13px; }
.support-launcher small { margin-top: 2px; color: var(--text-soft); font-size: 11px; }
.support-count,
.support-thread-unread {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  padding: 0 5px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.support-panel {
  position: fixed;
  z-index: 46;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 42px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(23, 40, 33, .24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.support-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.support-head { min-height: 72px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 40px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.support-head strong, .support-head small { display: block; }
.support-head strong { font-size: 13px; }
.support-head small { margin-top: 3px; color: var(--text-soft); font-size: 10px; }
.support-quick { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.support-quick .btn { width: 100%; background: var(--surface); }
.support-messages,
.support-dialog-messages { display: flex; flex-direction: column; gap: 9px; min-height: 0; overflow-y: auto; padding: 16px; }
.support-message { max-width: 82%; display: grid; gap: 5px; padding: 9px 11px; border-radius: 7px; background: var(--surface-2); color: var(--text); font-size: 13px; line-height: 1.45; }
.support-message.student { align-self: flex-start; }
.support-message.admin { align-self: flex-end; background: var(--primary); color: #fff; }
.support-message small { color: inherit; opacity: .7; font-size: 9px; }
.support-panel .support-message.student { align-self: flex-end; background: var(--primary); color: #fff; }
.support-panel .support-message.admin { align-self: flex-start; background: var(--surface-2); color: var(--text); }
.support-system-message { align-self: center; display: flex; align-items: center; gap: 6px; padding: 6px 9px; color: var(--text-soft); font-size: 10px; text-align: center; }
.support-system-message svg { width: 14px; }
.support-composer,
.support-dialog-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.support-composer textarea,
.support-dialog-composer textarea { min-height: 44px; max-height: 120px; resize: vertical; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; background: var(--surface); color: var(--text); outline: 0; }
.support-composer textarea:focus,
.support-dialog-composer textarea:focus { border-color: var(--primary); }
.support-welcome,
.support-loading { margin: auto; max-width: 280px; color: var(--text-soft); text-align: center; font-size: 12px; line-height: 1.55; }
.support-welcome > span { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.support-welcome strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 14px; }
.support-loading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.support-loading svg { width: 18px; animation: l2g-spin .8s linear infinite; }

.support-admin-shell {
  min-height: 620px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.support-thread-list { min-width: 0; border-right: 1px solid var(--line); background: var(--surface); }
.support-thread-list > header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); }
.support-thread-list > header small { color: var(--text-soft); }
.support-thread { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.support-thread:hover, .support-thread.active { background: var(--surface-2); }
.support-thread.active { box-shadow: inset 3px 0 var(--primary); }
.support-thread-copy, .support-thread-copy > span, .support-thread-copy > small { min-width: 0; }
.support-thread-copy { display: grid; gap: 5px; }
.support-thread-copy > span { display: flex; align-items: center; gap: 6px; }
.support-thread-copy > span:first-child { justify-content: space-between; }
.support-thread-copy > span:first-child small { flex: 0 0 auto; color: var(--text-soft); font-size: 9px; }
.support-thread-copy > small { overflow: hidden; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.support-tag { display: inline-flex; align-items: center; width: fit-content; padding: 3px 6px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: 8px; text-transform: uppercase; }
.support-tag.waiting { background: var(--amber-soft); color: var(--amber); }
.support-tag.closed { background: var(--surface-3); color: var(--text-soft); }
.support-empty-list { display: grid; place-items: center; gap: 8px; padding: 70px 20px; color: var(--text-soft); font-size: 12px; }
.support-empty-list svg { width: 28px; }
.support-dialog { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.support-dialog-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.support-dialog-head > div:last-child { display: flex; align-items: center; gap: 9px; }
.support-dialog-status { color: var(--text-soft); font-size: 10px; font-weight: 750; }
.support-dialog-status.waiting { color: var(--amber); }

@media (max-width: 850px) {
  .support-admin-shell { grid-template-columns: 1fr; }
  .support-thread-list { max-height: 280px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .support-dialog { min-height: 520px; }
}

@media (max-width: 560px) {
  .support-launcher { right: 14px; bottom: 14px; min-width: 176px; }
  .support-panel { right: 7px; bottom: 7px; width: calc(100vw - 14px); height: calc(100vh - 14px); }
  .support-dialog-head { align-items: flex-start; flex-direction: column; }
  .support-dialog-head > div:last-child { width: 100%; justify-content: space-between; }
  .section-tabs { width: 100%; }
  .section-tab { flex: 1 0 auto; justify-content: center; }
}

/* ===== Плеер курса ученика ===== */
.back-btn { margin-bottom: 14px; }
.next-lesson-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.next-lesson-banner h3 { margin: 4px 0 4px; }
.next-lesson-banner p { margin: 0; }
.course-hero { margin-bottom: 20px; }
.course-module-panel { margin-bottom: 18px; }
.course-lesson-list { display: grid; gap: 8px; }
.course-lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.course-lesson-row:hover { border-color: var(--primary); background: var(--surface-2); }
.course-lesson-row .lesson-row-copy { flex: 1; display: grid; gap: 2px; }
.course-lesson-row small { color: var(--text-soft); }
.lesson-no {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 13px;
}
.lesson-no.done, .course-lesson-row.done .lesson-no { background: var(--primary-soft); color: var(--primary); }
.lesson-no svg { width: 16px; height: 16px; }

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.lesson-main { display: grid; gap: 18px; min-width: 0; }
.lesson-article-head h2 { margin: 6px 0 10px; }
.lesson-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; color: var(--text-soft); font-size: 13px; }
.lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lesson-meta svg { width: 15px; height: 15px; }
.lesson-content { line-height: 1.65; }
.lesson-content p { margin: 0 0 12px; }
.lesson-materials { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.lesson-materials h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.lesson-materials h3 svg { width: 16px; height: 16px; }
.lesson-media { display: grid; gap: 8px; }
.lesson-media video, .lesson-media img { width: 100%; border-radius: 14px; }
.lesson-media audio { width: 100%; }

.lesson-quiz.panel {
  margin: 20px 0 24px;
  padding: 24px clamp(18px, 2.8vw, 30px) 22px;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--line));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(52, 25, 74, .075);
}
.lesson-quiz .panel-head { padding: 0 0 6px; margin-bottom: 4px; }
.lesson-quiz .panel-head h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 7px; font-size: 17px; font-weight: 750; }
.lesson-quiz .panel-head h2 svg { width: 19px; height: 19px; color: var(--primary); }
.lesson-quiz .panel-head p { display: inline-flex; align-items: center; max-width: 100%; margin: 0; padding: 5px 9px; border-radius: 999px; background: var(--cyan-soft); color: var(--text-soft); font-size: 12px; line-height: 1.4; }
.lesson-quiz form { display: grid; gap: 10px; min-width: 0; }
.quiz-question { min-width: 0; padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, var(--primary-soft)); display: grid; gap: 10px; box-shadow: 0 3px 10px rgba(52, 25, 74, .035); }
.quiz-question-head { display: flex; align-items: flex-start; gap: 10px; }
.quiz-question-head .lesson-no { flex: 0 0 30px; width: 30px; height: 30px; background: var(--cyan-soft); color: var(--cyan); }
.quiz-question-head strong { flex: 1; min-width: 0; padding-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }
.quiz-question-mark { flex: 0 0 auto; }
.quiz-question-mark svg.ok { color: var(--primary); }
.quiz-question-mark svg.bad { color: var(--coral); }
.lesson-quiz .learn-hint { justify-self: start; width: fit-content; max-width: 100%; margin: 0 0 0 40px; padding: 8px 11px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.lesson-quiz .learn-hint svg { flex: 0 0 16px; width: 16px; height: 16px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.quiz-option:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); background: var(--surface-2); }
.quiz-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
.quiz-option:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.quiz-option input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }
.quiz-option span { flex: 1; min-width: 0; line-height: 1.45; overflow-wrap: anywhere; }
.quiz-text-answer {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}
.quiz-text-answer:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.quiz-question-explain { color: var(--coral); line-height: 1.5; }
.quiz-actions { padding-top: 2px; display: flex; justify-content: flex-end; }
.quiz-actions .btn { min-width: 184px; min-height: 48px; justify-content: center; }
.quiz-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  font-size: 14px;
}
.lesson-quiz + .lesson-quiz { margin-top: 12px; }
.studio-student-section {
  padding: 20px 0;
  border-top: 1px solid rgba(124, 45, 145, .10);
}
.studio-student-section:first-child { border-top: 0; padding-top: 0; }
.studio-student-block { margin: 0 0 18px; }
.studio-student-block:last-child { margin-bottom: 0; }
.studio-student-block > h3,
.studio-student-block .studio-block-content > h3 { margin-bottom: 9px; }
.studio-student-block audio { display: block; min-height: 42px; border-radius: 22px; }
@media (max-width: 600px) {
  .lesson-quiz.panel { margin: 14px 0 18px; padding: 16px 12px 14px; border-radius: 16px; }
  .lesson-quiz .panel-head { padding-bottom: 5px; }
  .lesson-quiz .panel-head h2 { gap: 8px; font-size: 16px; }
  .lesson-quiz .panel-head p { font-size: 12px; }
  .quiz-question { padding: 13px 11px; border-radius: 12px; gap: 9px; }
  .quiz-question-head { gap: 9px; }
  .quiz-question-head strong { padding-top: 4px; font-size: 13px; }
  .lesson-quiz .learn-hint { margin-left: 39px; padding: 8px 10px; }
  .quiz-options { gap: 7px; }
  .quiz-option { min-height: 48px; padding: 13px 11px; border-radius: 10px; }
  .quiz-text-answer { min-height: 48px; font-size: 16px; }
  .quiz-actions { display: grid; grid-template-columns: minmax(0, 1fr); padding-top: 2px; }
  .quiz-actions .btn { width: 100%; min-width: 0; min-height: 50px; }
  .quiz-result { align-items: flex-start; padding: 11px 12px; font-size: 13px; }
}
.quiz-result.passed { background: var(--primary-soft); color: var(--primary); }
.quiz-result.failed { background: var(--amber-soft); color: var(--amber); }
.quiz-result svg { width: 22px; height: 22px; flex: 0 0 22px; }
.quiz-result span { display: grid; gap: 2px; }
.quiz-result small { color: var(--text-soft); }

.lesson-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lesson-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.lesson-nav .btn { max-width: 240px; flex-wrap: nowrap; }
.lesson-nav .btn .lesson-nav-label {
  display: inline-block;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-nav .btn svg { flex: 0 0 auto; }

/* Помощник в уроке */
.lesson-tutor {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
  min-height: 420px;
  padding: 0;
  overflow: hidden;
}
.lesson-tutor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.lesson-tutor-head span:last-child { display: grid; gap: 1px; }
.lesson-tutor-head small { color: var(--text-soft); }
.lesson-tutor-messages { flex: 1; overflow-y: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.tutor-suggestions { padding: 0 16px 10px; }
.lesson-tutor .chat-composer { border-top: 1px solid var(--line); }

.check-column { display: grid; gap: 8px; padding: 4px 0; }
.check-column label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check-column input { accent-color: var(--primary); }
.quiz-type-picker { display: inline-flex; align-items: center; gap: 8px; }
.quiz-type-picker select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-tutor { position: static; max-height: none; min-height: 380px; }
}

/* ===== Уведомления и каналы ===== */
.notify-stack {
  position: fixed;
  z-index: 99;
  right: 18px;
  bottom: 96px;
  display: grid;
  gap: 9px;
  width: min(380px, calc(100vw - 36px));
}
.toast.notify {
  grid-template-columns: 28px 1fr 22px;
  border-left: 3px solid var(--primary);
}
.notify-close {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.notify-close:hover { color: var(--text); }

.settings-column { display: grid; gap: 18px; min-width: 0; }
.notify-channels { display: grid; gap: 14px; margin-bottom: 14px; }
.notify-channel { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.notify-channel-head { display: flex; align-items: center; gap: 12px; }
.notify-channel-head div { flex: 1; display: grid; gap: 2px; }
.notify-channel-head small { color: var(--text-soft); }
.notify-channel-body { display: flex; gap: 10px; }
.notify-channel-body input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: 0 0 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: var(--surface-3);
  transition: background .18s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
  transition: transform .18s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ===== База знаний ===== */
.check-inline { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; cursor: pointer; }
.check-inline input { accent-color: var(--primary); width: 18px; height: 18px; }
.knowledge-err { color: var(--coral); }
.knowledge-log-panel { align-self: start; position: sticky; top: 84px; }
.knowledge-logs { display: grid; gap: 2px; max-height: 480px; overflow-y: auto; margin-top: 12px; }
.knowledge-log { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.knowledge-log:last-child { border-bottom: 0; }
.knowledge-log-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; flex: 0 0 8px; background: var(--primary); }
.knowledge-log.warning .knowledge-log-dot { background: var(--amber); }
.knowledge-log.error .knowledge-log-dot { background: var(--coral); }
.knowledge-log-body { display: grid; gap: 2px; }
.knowledge-log-body small { color: var(--text-soft); }
