:root {
  --bg: #0c0c14;
  --bg-elev: #14141d;
  --text: #e0e0ec;
  --text-muted: #8888a0;
  --accent: #f0c040;
  --green: #3ddc97;
  --red: #ff6b6b;
  --blue: #5b8dee;
  --border: #1f1f2e;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--text-muted); font-size: 14px; }

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero h1 {
  font-size: 56px;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: 20px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

button, .btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
}

button:hover, .btn:hover {
  filter: brightness(1.1);
  text-decoration: none;
}

input, textarea {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.auth-brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: 24px;
  margin: 0 0 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-form button {
  margin-top: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-success {
  background: rgba(61, 220, 151, 0.1);
  color: var(--green);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

/* === Админ-шапка === */
.admin-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}
.admin-brand {
  font-weight: 700;
  color: var(--text);
}
.admin-nav {
  display: flex;
  gap: 24px;
  flex: 1;
}
.admin-nav a {
  color: var(--text-muted);
  font-size: 14px;
}
.admin-nav a:hover { color: var(--text); text-decoration: none; }
.admin-logout-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.admin-logout-form button {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 400;
}
.admin-main { padding: 32px 24px 80px; }

/* === Хлебные крошки === */
.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumbs a { color: var(--text-muted); }

/* === Заголовок страницы === */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
}

/* === Карточки на дашборде === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card-soon { opacity: 0.5; pointer-events: none; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.card-meta { font-size: 13px; color: var(--text-muted); }

/* === Списки (модули/уроки/курсы) === */
.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.list-item:hover { border-color: var(--accent); text-decoration: none; }
.list-item-num {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 14px;
  min-width: 36px;
}
.list-item-main { flex: 1; }
.list-item-title { font-weight: 500; }
.list-item-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* === Пустое состояние === */
.empty {
  padding: 32px;
  text-align: center;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* === Бейджи === */
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-muted { background: var(--border); color: var(--text-muted); }

/* === Формы === */
.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.form-card label.checkbox {
  flex-direction: row;
  align-items: center;
  cursor: pointer;
}
.form-card label.checkbox input { width: auto; }
.form-card small { color: var(--text-muted); font-size: 12px; }
.form-card fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-card fieldset legend {
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* === Inline формы (добавить модуль/урок) === */
.inline-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.inline-form input { flex: 1; }
.inline-form button { white-space: nowrap; }

/* === Секция === */
.section { margin-top: 32px; }
.section-head h2 { margin-top: 0; font-size: 20px; }

/* === Дополнительные кнопки === */
.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.3);
  padding: 12px 24px;
  font-weight: 500;
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
}

/* === Загрузка видео === */
.video-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.video-empty-text { font-size: 14px; margin-bottom: 12px; }

.video-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.video-drop.drag-over {
  border-color: var(--accent);
  background: rgba(240, 192, 64, 0.05);
}
.video-drop-icon { font-size: 36px; margin-bottom: 12px; }
.video-drop-text { font-size: 16px; margin-bottom: 8px; }
.video-drop-or { font-size: 13px; margin-bottom: 12px; }

.video-progress {
  padding: 24px;
  background: rgba(91, 141, 238, 0.05);
  border: 1px solid rgba(91, 141, 238, 0.2);
  border-radius: var(--radius);
}
.video-progress-label { margin-bottom: 12px; font-size: 14px; }
.video-progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.video-progress-bar-fill {
  height: 100%;
  background: var(--blue);
  transition: width 0.2s;
}

.video-ready {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(61, 220, 151, 0.05);
  border: 1px solid rgba(61, 220, 151, 0.2);
  border-radius: var(--radius);
}
.video-ready-thumb {
  width: 120px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.video-ready-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-ready-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 24px;
}
.video-ready-info { flex: 1; min-width: 0; }
.video-ready-title { font-weight: 500; margin-bottom: 4px; }

/* === Студенческий layout === */
.student-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.student-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}
.student-brand {
  font-weight: 700;
  color: var(--text);
}
.student-nav {
  display: flex;
  gap: 24px;
  flex: 1;
}
.student-nav a {
  color: var(--text-muted);
  font-size: 14px;
}
.student-nav a:hover { color: var(--text); text-decoration: none; }
.student-main { padding: 32px 24px 80px; max-width: 800px; }

.preview-badge {
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Урок: студенческий вид === */
.lesson-crumbs {
  font-size: 13px;
  margin-bottom: 8px;
}
.lesson-title {
  margin: 0 0 24px;
  font-size: 32px;
  letter-spacing: -0.01em;
}
.lesson-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.lesson-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.lesson-no-video {
  padding: 60px;
  text-align: center;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  margin-bottom: 32px;
}
.lesson-no-video-icon { font-size: 36px; margin-bottom: 8px; }

.lesson-content {
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.7;
}
.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
  margin-top: 28px;
  margin-bottom: 12px;
}
.lesson-content h2 { font-size: 22px; }
.lesson-content h3 { font-size: 18px; }
.lesson-content p { margin: 0 0 16px; }
.lesson-content ul,
.lesson-content ol { padding-left: 24px; margin-bottom: 16px; }
.lesson-content li { margin-bottom: 6px; }
.lesson-content a { color: var(--accent); }
.lesson-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: 16px 0;
  color: var(--text-muted);
}
.lesson-content pre {
  background: var(--bg-elev);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  border: 1px solid var(--border);
}
.lesson-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.lesson-homework {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lesson-homework h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
  color: var(--accent);
}
.lesson-homework-text {
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.lesson-homework-form {
  padding: 20px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-size: 14px;
  text-align: center;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.lesson-nav-link {
  display: block;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  max-width: 45%;
}
.lesson-nav-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.lesson-nav-next { text-align: right; margin-left: auto; }

/* === Сетка инфо (поток/студент) === */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.info-grid > div { padding: 4px 0; }

select {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23888' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select:focus { outline: none; border-color: var(--accent); }
select option { background: var(--bg-elev); }
input:disabled { opacity: 0.6; cursor: not-allowed; }

/* === Превью «от лица студента» === */
.preview-as-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(240, 192, 64, 0.08);
  border: 1px solid rgba(240, 192, 64, 0.2);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 13px;
}
.preview-as-bar select {
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  flex: 0 1 auto;
  min-width: 180px;
}

/* === Статус ДЗ у студента === */
.hw-status {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.hw-status-pending {
  background: rgba(91, 141, 238, 0.1);
  color: var(--blue);
  border: 1px solid rgba(91, 141, 238, 0.3);
}
.hw-status-accepted {
  background: rgba(61, 220, 151, 0.1);
  color: var(--green);
  border: 1px solid rgba(61, 220, 151, 0.3);
}
.hw-status-needs-work {
  background: rgba(240, 192, 64, 0.1);
  color: var(--accent);
  border: 1px solid rgba(240, 192, 64, 0.3);
}

.hw-feedback {
  margin: 12px 0 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.hw-feedback-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.hw-feedback-body { white-space: pre-wrap; font-size: 14px; }

.hw-submission { margin-top: 12px; }
.hw-submission-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 4px;
}
.hw-submission-block {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 14px;
  word-break: break-word;
}

.hw-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.hw-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.hw-form input[type="file"] {
  padding: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
}

/* === Админ-проверка ДЗ === */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hw-review-section {
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hw-review-section h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
}
.hw-review-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hw-review-block {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  word-break: break-word;
}

.hw-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hw-template-chip {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.hw-template-chip:hover { border-color: var(--accent); }

.btn-accept {
  background: var(--green);
  color: var(--bg);
}
.btn-accept:hover { filter: brightness(1.1); }
.btn-needs-work {
  background: var(--accent);
  color: var(--bg);
}
.btn-needs-work:hover { filter: brightness(1.1); }

/* === Список модулей в курсе (GetCourse-style карточки) === */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.module-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
.module-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.module-card-locked { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.module-card-num {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  flex-shrink: 0;
}
.module-card-calls .module-card-num { font-size: 18px; }
.module-card-main { flex: 1; min-width: 0; }
.module-card-title { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.module-card-meta { font-size: 13px; color: var(--text-muted); }
.module-card-chev {
  color: var(--text-muted);
  font-size: 18px;
}

/* === Уроки внутри модуля === */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.lesson-row:hover { border-color: var(--accent); text-decoration: none; }
.lesson-row-locked { opacity: 0.55; cursor: not-allowed; }
.lesson-row-marker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  color: var(--text-muted);
}
.lesson-row-done .lesson-row-marker {
  background: var(--green);
  border-color: var(--green);
  color: var(--bg);
  font-weight: 700;
}
.lesson-row-done .lesson-row-title { color: var(--text-muted); }
.lesson-row-main { flex: 1; min-width: 0; }
.lesson-row-title { font-weight: 500; font-size: 15px; }
.lesson-row-sub { font-size: 12px; margin-top: 2px; }
.lesson-row-chev { color: var(--text-muted); font-size: 16px; }

/* === Аккордеон-папки на странице курса (deprecated, оставлены для совместимости) === */
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.folder {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.folder[open] { border-color: rgba(240, 192, 64, 0.25); }
.folder > summary {
  list-style: none;
  cursor: pointer;
}
.folder > summary::-webkit-details-marker { display: none; }
.folder-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  transition: background 0.1s;
}
.folder-head:hover { background: rgba(255,255,255,0.02); }

.folder-marker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.folder[open] .folder-marker {
  color: var(--accent);
  border-color: var(--accent);
}
.folder-main { flex: 1; min-width: 0; }
.folder-title { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.folder-meta { font-size: 13px; color: var(--text-muted); }

.folder-chev {
  color: var(--text-muted);
  font-size: 14px;
  transition: transform 0.2s;
}
.folder[open] .folder-chev { transform: rotate(180deg); }

.folder-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin: 0 12px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
}
.folder-item:hover {
  background: var(--bg);
  text-decoration: none;
}
.folder-item-locked { opacity: 0.55; cursor: not-allowed; }
.folder-item-locked:hover { background: transparent; }
.folder-item-upcoming {
  background: rgba(240,192,64,0.06);
  border-color: rgba(240,192,64,0.15);
}

.folder-item-marker {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  color: var(--text-muted);
}
.folder-item-done .folder-item-marker {
  background: var(--green);
  border-color: var(--green);
  color: var(--bg);
  font-weight: 700;
}
.folder-item-done .folder-item-title { color: var(--text-muted); }
.folder-item-title { flex: 1; font-size: 15px; }
.folder-item-badge { font-size: 12px; white-space: nowrap; }
.folder-item-cta {
  background: var(--accent);
  color: var(--bg);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.folder-item-cta:hover { filter: brightness(1.1); text-decoration: none; }

.folder-calls .folder-marker { font-size: 16px; }

/* === Старый список курса (для обратной совместимости, оставим но не используется) === */
.course-module {
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.course-module-title {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
}
.course-lesson-list { display: flex; flex-direction: column; gap: 4px; }
.course-lesson {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.course-lesson:hover { border-color: var(--accent); text-decoration: none; }
.course-lesson-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.course-lesson-locked:hover { border-color: transparent; }
.course-lesson-marker {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.course-lesson-done .course-lesson-marker {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}
.course-lesson-done .course-lesson-title {
  color: var(--text-muted);
}
.course-lesson-title { flex: 1; font-size: 15px; }
.course-lesson-badge { font-size: 12px; white-space: nowrap; }

/* === Кнопка «я посмотрел» === */
.lesson-mark-section { margin: 24px 0 40px; }
.btn-mark-done {
  background: var(--green);
  color: var(--bg);
  font-size: 15px;
  padding: 14px 24px;
  width: 100%;
}
.btn-mark-done:hover { filter: brightness(1.1); }
.lesson-mark-done {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.3);
  border-radius: var(--radius);
  color: var(--green);
  font-size: 14px;
}

/* === Алерт «закрыто» === */
.alert-locked {
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
}

/* === Студенческий дашборд === */
.dash-greeting {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}
.rank-pill {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-left: 4px;
}

.factory-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.factory-stage {
  background: var(--sky, #0c0c14);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.factory-svg { display: block; width: 100%; height: auto; }
.factory-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  padding: 0 8px;
}
.factory-stat { text-align: center; }
.factory-stat-num {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.factory-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.next-action {
  display: block;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-decoration: none;
  margin-bottom: 32px;
  text-align: center;
  transition: filter 0.15s;
}
.next-action:hover { filter: brightness(1.1); text-decoration: none; }
.next-action-label { font-size: 22px; font-weight: 700; }
.next-action-sub { font-size: 14px; opacity: 0.85; margin-top: 4px; }
.next-action-empty {
  background: var(--bg-elev);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.dash-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.dash-course-link {
  flex: 1;
  min-width: 200px;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.dash-course-link:hover { border-color: var(--accent); text-decoration: none; }
.dash-course-title { font-weight: 600; margin-bottom: 4px; }

.dash-badges h2 { font-size: 18px; margin-bottom: 12px; }
.badge-row { display: flex; gap: 12px; flex-wrap: wrap; }
.badge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
}
.badge-icon { font-size: 18px; }

/* === Дашборд: верхний блок (ранг + стрик) === */
.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.dash-hello { font-size: 22px; margin-bottom: 6px; }
.dash-rank { font-size: 14px; color: var(--text-muted); }

.dash-streak {
  text-align: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  min-width: 120px;
}
.dash-streak-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* === Блоки на дашборде === */
.dash-block { margin-bottom: 32px; }
.dash-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.dash-block-head h2 { margin: 0; font-size: 18px; }

/* === Мини-карточки ачивок на дашборде === */
.ach-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.ach-mini {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform 0.1s, border-color 0.15s;
}
.ach-mini:hover { text-decoration: none; transform: translateY(-1px); }
.ach-mini-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.ach-mini-text { min-width: 0; }
.ach-mini-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }

/* === Большой грид ачивок === */
.ach-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.ach-head h1 { margin: 4px 0 0; }
.ach-progress { text-align: right; }
.ach-progress-num { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }

.ach-progress-bar {
  height: 8px;
  background: var(--bg-elev);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}
.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffd96b);
  transition: width 0.3s;
}

.ach-section { margin-bottom: 32px; }
.ach-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Базовая карточка */
.ach-card {
  position: relative;
  padding: 16px 14px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.ach-card.earned:hover {
  transform: translateY(-2px);
}
.ach-icon {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-weight: 300;
}
.ach-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.ach-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 32px;
}
.ach-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}
.ach-rarity-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

/* === Состояние: locked === */
.ach-card.locked { opacity: 0.55; }
.ach-card.locked .ach-icon { opacity: 0.3; }
.ach-card.locked .ach-title { color: var(--text-muted); }

/* === Earned: подача спокойнее, главный цвет — слабая обводка + цвет иконки === */
.ach-card.earned .ach-icon { color: var(--text); }
.ach-card.earned.ach-common {
  border-color: rgba(255,255,255,0.12);
}
.ach-card.earned.ach-rare {
  border-color: rgba(91,141,238,0.5);
}
.ach-card.earned.ach-rare .ach-icon { color: var(--blue); }

.ach-card.earned.ach-epic {
  border-color: rgba(176,107,255,0.55);
}
.ach-card.earned.ach-epic .ach-icon { color: #c89bff; }

.ach-card.earned.ach-legendary {
  border-color: var(--accent);
}
.ach-card.earned.ach-legendary .ach-icon { color: var(--accent); }

/* Лейблы редкости — тонкие */
.ach-rarity-label {
  background: transparent !important;
  color: var(--text-muted) !important;
  padding: 0;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.ach-card.earned.ach-rare .ach-rarity-label { color: var(--blue) !important; }
.ach-card.earned.ach-epic .ach-rarity-label { color: #c89bff !important; }
.ach-card.earned.ach-legendary .ach-rarity-label { color: var(--accent) !important; }

/* Mini-карточки */
.ach-mini.ach-rare { border-color: rgba(91,141,238,0.35); }
.ach-mini.ach-epic { border-color: rgba(176,107,255,0.45); }
.ach-mini.ach-legendary { border-color: var(--accent); }
.ach-mini.ach-rare .ach-mini-icon { color: var(--blue); }
.ach-mini.ach-epic .ach-mini-icon { color: #c89bff; }
.ach-mini.ach-legendary .ach-mini-icon { color: var(--accent); }
.ach-mini-icon { color: var(--text-muted); font-weight: 300; font-size: 22px; }

/* === Магазин XP === */
.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  gap: 24px;
}
.shop-head h1 { margin: 4px 0 8px; font-size: 36px; letter-spacing: -0.02em; }
.balance-card {
  background: linear-gradient(135deg, rgba(240,192,64,0.16), rgba(240,192,64,0.06));
  border: 1px solid rgba(240,192,64,0.4);
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  flex-shrink: 0;
  min-width: 160px;
}
.balance-num {
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 4px;
}

.shop-section { margin-bottom: 48px; }
.shop-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.shop-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}

/* === Featured (хиро) === */
.shop-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.shop-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid rgba(240,192,64,0.35);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.shop-hero:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.shop-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}
.shop-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-hero-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(240,192,64,0.18), rgba(91,141,238,0.12));
}
.shop-hero-glyph { font-size: 64px; color: var(--accent); opacity: 0.7; }
.shop-hero-body { padding: 24px 24px 22px; }
.shop-hero-cost {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.shop-hero-title { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.shop-hero-value { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.shop-hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 16px;
}
.shop-hero-disabled { opacity: 0.6; }

/* === Обычные карточки === */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.1s;
}
.shop-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.shop-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.shop-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg));
}
.shop-card-glyph { font-size: 56px; color: var(--text-muted); opacity: 0.4; font-weight: 300; }

.shop-card-body { padding: 16px 18px 8px; flex: 1; }
.shop-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.shop-card-value { font-size: 13px; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.shop-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.shop-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.shop-card-cost {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.shop-card-disabled { opacity: 0.55; }
.shop-card-disabled .shop-card-cost { color: var(--text-muted); }

/* === Админская сетка товаров === */
.admin-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.admin-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
.admin-shop-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.admin-shop-card-featured { border-color: rgba(240,192,64,0.45); }
.admin-shop-card-hidden { opacity: 0.5; }

.admin-shop-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.admin-shop-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-shop-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg));
}
.admin-shop-glyph { font-size: 48px; color: var(--text-muted); opacity: 0.5; font-weight: 300; }

.admin-shop-body {
  padding: 14px 16px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-shop-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(240,192,64,0.15);
  color: var(--accent);
  border-radius: 10px;
  font-weight: 600;
}
.admin-shop-badge-hidden { background: var(--border); color: var(--text-muted); }
.admin-shop-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.admin-shop-value { font-size: 12px; color: var(--text-muted); }
.admin-shop-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}
.admin-shop-cost {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* === Welcome-экран === */
.welcome-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 0 40px;
}
.welcome-title {
  font-size: 36px;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.welcome-lead {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 32px;
  line-height: 1.55;
}
.welcome-text {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
}
.welcome-checklist {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 32px;
}
.welcome-checklist h2 { margin: 0 0 16px; font-size: 18px; }
.welcome-checklist ol {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.welcome-checklist li { font-size: 15px; line-height: 1.5; }
.welcome-checklist li strong { display: block; margin-bottom: 4px; }

.welcome-cta {
  display: block;
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
  padding: 18px 24px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
}
.welcome-cta:hover { filter: brightness(1.1); }

/* === Кнопки перестановки ↑↓ === */
.reorder-buttons {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.list-item:hover .reorder-buttons { opacity: 1; }

.reorder-btn {
  width: 20px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
.reorder-btn:hover:not(:disabled) {
  background: var(--bg);
  color: var(--accent);
}
.reorder-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* === Toast (всплывающее уведомление о XP/достижениях) === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--bg);
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
}
.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === XP-плашка под кнопкой "Я посмотрел" === */
.btn-mark-done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-mark-done-xp {
  background: rgba(0,0,0,0.15);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* === Заблокированная навигация урока === */
.lesson-nav-link-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  max-width: 45%;
  display: block;
}

/* === Точка "новый урок" === */
.lesson-new-dot {
  color: var(--accent);
  font-size: 10px;
  vertical-align: middle;
  margin-left: 6px;
}
.lesson-row-new {
  border-color: rgba(240, 192, 64, 0.3);
  background: linear-gradient(90deg, rgba(240,192,64,0.04), transparent);
}

/* === Профиль === */
.profile-block { margin-bottom: 40px; }
.profile-block h2 { font-size: 18px; margin: 0 0 16px; }

.avatar-row {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initial {
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
}

/* === Закладка в шапке урока === */
.bookmark-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bookmark-btn:hover { border-color: var(--accent); color: var(--accent); }
.bookmark-btn-active { color: var(--accent); border-color: var(--accent); background: rgba(240,192,64,0.1); }

/* === Dropzone ДЗ === */
.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone-over { border-color: var(--accent); background: rgba(240,192,64,0.05); }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-empty strong { display: block; font-size: 14px; }
.dropzone-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.dropzone-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.dropzone-icon { font-size: 36px; flex-shrink: 0; }
.dropzone-info { flex: 1; min-width: 0; word-break: break-all; }

/* === Глобальный поиск Cmd+K === */
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text); }
.search-trigger kbd {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
}

.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh; z-index: 100;
}
.search-overlay[hidden] { display: none !important; }
.search-modal {
  width: 640px; max-width: 92vw;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
  overflow: hidden;
}
#search-input {
  border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: transparent;
  padding: 18px 22px; font-size: 16px; width: 100%;
}
#search-input:focus { outline: none; }
.search-results { max-height: 60vh; overflow-y: auto; }
.search-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; color: var(--text); text-decoration: none;
  border-left: 3px solid transparent;
}
.search-item:hover, .search-item-active {
  background: var(--bg); border-left-color: var(--accent);
  text-decoration: none;
}
.search-item-icon { font-size: 18px; width: 24px; text-align: center; color: var(--text-muted); }
.search-item-text { flex: 1; min-width: 0; }
.search-item-title { display: block; font-weight: 500; }
.search-item-sub { display: block; font-size: 12px; margin-top: 2px; }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-foot { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; }
.search-close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px;
  background: transparent; border: 0;
  color: var(--text-muted); font-size: 22px; line-height: 1;
  cursor: pointer; font-family: inherit;
  border-radius: 50%;
}
.search-close:hover { background: var(--bg); color: var(--text); }
.search-modal { position: relative; }

/* === Фильтры магазина и достижений === */
.shop-filters {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-bottom: 24px;
}

/* === Записи созвонов === */
.recordings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.recording-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.recording-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.recording-title { font-weight: 600; margin-bottom: 4px; }
.recording-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
}
.recording-video iframe {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.recording-pending {
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
}

.lesson-video-title {
  font-size: 16px;
  margin: 20px 0 8px;
  font-weight: 600;
}
.lesson-video-title:first-child { margin-top: 0; }

/* Материалы урока */
.lesson-files { margin: 24px 0; }
.lesson-files h2 { margin-bottom: 12px; }
.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.attach-item:hover { border-color: var(--accent); transform: translateX(2px); }
.attach-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  color: var(--accent); flex-shrink: 0;
}
.attach-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attach-title { font-weight: 500; font-size: 14px; }
.attach-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-download { font-size: 20px; color: var(--text-muted); }

/* Поиск: сниппет */
.search-item-snippet {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
  font-style: italic;
}
.search-item-snippet mark {
  background: rgba(240, 192, 64, 0.25);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 2px;
  font-style: normal;
}

/* «На этой неделе» */
.week-list { display: flex; flex-direction: column; gap: 8px; }
.week-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.week-item:hover { border-color: var(--accent); transform: translateX(2px); }
.week-item-warn { border-left: 3px solid var(--red); }
.week-item-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 4px 8px; background: var(--bg); border-radius: 4px;
  flex-shrink: 0;
}
.week-item-warn .week-item-tag { color: var(--red); }
.week-item-title { flex: 1; font-size: 14px; }
.week-item-arrow { color: var(--text-muted); }

/* Welcome modal */
.welcome-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.welcome-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 480px; width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.welcome-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 0;
  font-size: 28px; line-height: 1;
  cursor: pointer; padding: 4px 10px;
  color: var(--text-muted);
}
.welcome-close:hover { color: var(--text); }

/* Адаптив для мобильных */
@media (max-width: 768px) {
  .wrap, .wrap-wide { padding: 0 12px; }
  .student-header-inner { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .student-brand { font-size: 16px; }
  .student-nav { gap: 12px; flex-wrap: wrap; font-size: 14px; }
  .student-nav a { padding: 4px 0; }
  .search-trigger { padding: 6px 10px; font-size: 13px; }
  .search-trigger kbd { display: none; }

  .dash-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .dash-streak { flex: 1; }
  .factory-card { padding: 16px; }
  .factory-meta { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .factory-stat-num { font-size: 22px; }
  .next-action { padding: 16px; }
  .next-action-label { font-size: 16px; }

  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .lesson-title { font-size: 20px; }
  .lesson-content { font-size: 15px; }

  .shop-featured-grid, .shop-grid, .ach-grid {
    grid-template-columns: 1fr !important;
  }
  .dash-row { grid-template-columns: 1fr !important; }
  .ach-row { grid-template-columns: 1fr !important; }

  .lesson-nav { flex-direction: column; gap: 8px; }
  .lesson-nav-link { width: 100%; }

  .preview-as-bar { flex-direction: column; align-items: stretch; }
  .preview-as-bar select { width: 100%; }

  .ach-head, .shop-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .balance-card { align-self: flex-start; }

  .hw-form input[type="text"],
  .hw-form input[type="url"],
  .hw-form textarea { font-size: 16px; } /* предотвращает zoom на iOS */
  input[type="text"], input[type="email"], input[type="url"], input[type="number"], textarea, select { font-size: 16px; }

  table { font-size: 13px; }
  .welcome-modal { padding: 20px; }

  /* Sticky кнопка отметки урока на мобилке */
  .lesson-mark-section {
    position: sticky; bottom: 0;
    background: var(--bg);
    padding: 12px 0;
    z-index: 10;
    border-top: 1px solid var(--border);
    margin: 24px -12px 0;
    padding-left: 12px; padding-right: 12px;
  }
  .btn-mark-done { width: 100%; padding: 14px; }
}

@media (max-width: 480px) {
  .factory-meta { grid-template-columns: 1fr 1fr; }
  .dash-hello { font-size: 14px; }
  .factory-stat-num { font-size: 20px; }
}
