/* ============================================================
   CONGIX CODE — Внутренние страницы
   Обучение · Задания · Проекты · Прогресс · Настройки · Создать с ИИ

   Всё собрано из тех же деталей, что и дашборд: прозрачное стекло
   --glass-folder без размытия, скругления 36–40px, тонкие цифры,
   тёмные пилюли статусов с цветной обводкой.
   ============================================================ */

/* ── Шапка страницы: заголовок слева, действия справа ── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1.75rem;
}
.page-head .dash-title { white-space: normal; margin-bottom: 0.6rem; }
.page-head .dash-sub { max-width: 60ch; }
.page-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.page-head .tiles { grid-area: auto; }

/* Кнопка-пилюля с градиентом (как «Новый проект» на дашборде) */
.cta {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  background: var(--gradient-accent);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-weight: 500; font-size: 0.98rem;
  box-shadow: 0 10px 34px var(--color-accent-glow), inset 0 1px 0 rgba(255,255,255,0.3);
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta:hover { transform: translateY(-1px); text-decoration: none; }
.cta:active { transform: scale(0.98); }
.cta-ghost {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  background: var(--glass-folder);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  color: var(--color-text); font-size: 0.95rem;
  white-space: nowrap;
}
.cta-ghost:hover { border-color: rgba(255,255,255,0.35); text-decoration: none; }
:root[data-theme="light"] .cta-ghost { background: rgba(255,255,255,0.8); border-color: rgba(11,18,32,0.12); box-shadow: none; }

/* Стеклянная карточка общего назначения — то же стекло, что у панелей */
.glass-card {
  border-radius: 36px;
  background:
    radial-gradient(90% 60% at 30% 120%, rgba(109,74,255,0.24) 0%, transparent 70%),
    var(--glass-folder);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 18px 40px rgba(0,0,0,0.30);
}
:root[data-theme="light"] .glass-card {
  background:
    radial-gradient(90% 60% at 30% 120%, rgba(109,74,255,0.10) 0%, transparent 70%),
    linear-gradient(150deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
  border-color: rgba(11,18,32,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 40px rgba(11,18,32,0.08);
}

/* Фильтры-сегменты над списком */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filters button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  background: var(--glass-folder);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.72); font-size: 0.88rem;
  transition: border-color 0.18s, color 0.18s;
}
.filters button:hover { border-color: rgba(255,255,255,0.32); color: #fff; }
.filters button[aria-pressed="true"] { background: var(--gradient-accent); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.filters button em { font-style: normal; font-size: 0.75rem; opacity: 0.7; }
:root[data-theme="light"] .filters button { background: rgba(255,255,255,0.8); border-color: rgba(11,18,32,0.12); color: var(--color-mid); }
:root[data-theme="light"] .filters button[aria-pressed="true"] { color: #fff; }

/* Круглая иконка курса (как у плиток) */
.c-ic {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.30);
  color: rgba(255,255,255,0.9);
}
:root[data-theme="light"] .c-ic { border-color: rgba(11,18,32,0.2); color: var(--color-text); }

/* Тёмные пилюли статуса — везде на внутренних страницах, как на дашборде */
.pg .pill-s {
  padding: 0.28rem 0.75rem; font-size: 0.78rem;
  background: rgba(10,12,16,0.6); border: 1px solid var(--pill-line); color: rgba(255,255,255,0.88);
  white-space: nowrap;
}
.pg .pill-s::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pill-dot); }
:root[data-theme="light"] .pg .pill-s { background: rgba(255,255,255,0.8); color: var(--color-text); }

/* ============================================================
   ОБУЧЕНИЕ
   ============================================================ */
.learn-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.course-list { display: flex; flex-direction: column; gap: 1rem; }
.course-card {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 1.1rem; align-items: center;
  width: 100%; padding: 22px 24px; text-align: left;
  border-radius: 36px;
  transition: transform 0.2s, border-color 0.2s;
}
.course-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.32); }
.course-card[aria-pressed="true"] { border-color: rgba(167,139,250,0.7); box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 0 0 1px rgba(167,139,250,0.35), 0 18px 40px rgba(109,74,255,0.25); }
.course-card[data-state="locked"] { opacity: 0.55; }
.course-card .cc-name { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 1.1rem; margin-bottom: 0.2rem; }
.course-card .cc-desc { font-size: 0.86rem; color: rgba(255,255,255,0.58); margin: 0 0 0.75rem; line-height: 1.45; }
.course-card .cc-count { font-size: 0.85rem; color: rgba(255,255,255,0.7); white-space: nowrap; align-self: start; padding-top: 0.2rem; }
:root[data-theme="light"] .course-card .cc-desc, :root[data-theme="light"] .course-card .cc-count { color: var(--color-mid); }

.lessons { padding: 26px 28px 28px; position: sticky; top: 1rem; }
.lessons-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.lessons-head h3 { margin: 0; font-size: 1.25rem; font-weight: 500; }
.lessons-head p { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lesson {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0.9rem; align-items: center;
  width: 100%; padding: 10px 12px; border-radius: 18px; text-align: left;
  transition: background 0.15s;
}
.lesson:hover { background: rgba(255,255,255,0.06); }
.lesson[disabled] { cursor: not-allowed; opacity: 0.5; }
.lesson[disabled]:hover { background: none; }
.l-num {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.22); font-size: 0.82rem; color: rgba(255,255,255,0.75);
}
.lesson.done .l-num { background: rgba(74,222,128,0.14); border-color: rgba(74,222,128,0.45); color: #4ade80; }
.lesson.current .l-num { background: var(--gradient-accent); border-color: transparent; color: #fff; box-shadow: 0 0 16px var(--color-accent-glow); }
.l-title { font-size: 0.95rem; }
.l-side { font-size: 0.8rem; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 0.4rem; }
.lesson.current .l-side { color: #c4b5fd; }
:root[data-theme="light"] .l-num { border-color: rgba(11,18,32,0.2); color: var(--color-mid); }
:root[data-theme="light"] .lesson:hover { background: rgba(11,18,32,0.04); }
:root[data-theme="light"] .l-side, :root[data-theme="light"] .lessons-head p { color: var(--color-mid); }

/* Окно урока */
.lesson-modal-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lesson-points { list-style: none; margin: 0.4rem 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lesson-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: rgba(255,255,255,0.78); }
.lesson-points li svg { flex-shrink: 0; margin-top: 3px; color: #a78bfa; }
:root[data-theme="light"] .lesson-points li { color: var(--color-text); }

/* ============================================================
   ЗАДАНИЯ
   ============================================================ */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.task-card {
  display: flex; flex-direction: column; gap: 0.8rem;
  padding: 24px 24px 22px; text-align: left; width: 100%;
  border-radius: 36px;
  transition: transform 0.2s, border-color 0.2s;
}
.task-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.32); }
.task-card[data-status="locked"] { opacity: 0.6; }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.tc-course { display: flex; align-items: center; gap: 0.7rem; font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.tc-course .c-ic { width: 40px; height: 40px; }
.task-card h3 { margin: 0.2rem 0 0; font-size: 1.15rem; font-weight: 500; }
.task-card p {
  margin: 0; font-size: 0.88rem; color: rgba(255,255,255,0.6); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; padding-top: 0.4rem; font-size: 0.84rem; color: rgba(255,255,255,0.6); }
.tc-due { display: flex; align-items: center; gap: 0.4rem; }
.tc-due.late { color: #fca5a5; }
.tc-points { color: #c4b5fd; }
.empty {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem; text-align: center;
  color: rgba(255,255,255,0.55);
}
:root[data-theme="light"] .tc-course, :root[data-theme="light"] .task-card p, :root[data-theme="light"] .tc-bottom, :root[data-theme="light"] .empty { color: var(--color-mid); }

.crit { list-style: none; margin: 0.4rem 0 0.2rem; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.crit li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
}
.crit li i {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.crit li.ok i { background: rgba(74,222,128,0.18); border-color: rgba(74,222,128,0.6); color: #4ade80; }
.task-facts { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0 0.2rem; font-size: 0.88rem; color: rgba(255,255,255,0.65); }
.task-facts span { display: flex; align-items: center; gap: 0.45rem; }
:root[data-theme="light"] .crit li { background: #fff; border-color: var(--color-border); }
:root[data-theme="light"] .task-facts { color: var(--color-mid); }

/* ============================================================
   ПРОЕКТЫ: карточки-папки в сетке
   ============================================================ */
.proj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 248px);
  justify-content: start; gap: 2.2rem 1.6rem;
  padding-top: 14px;
}
.proj-grid .fnode { width: 248px; }
.proj-grid .fcard { cursor: pointer; }
.proj-grid .fcard-knob { cursor: pointer; transition: transform 0.18s, border-color 0.18s; }
.proj-grid .fcard-knob:hover { transform: scale(1.06); border-color: rgba(255,255,255,0.4); }
.proj-grid .fcard-knob svg { color: #fff; }
.fnode.add .fcard-bg { background: rgba(255,255,255,0.03); }
.fnode.add .fcard-edge path { stroke-dasharray: 6 6; stroke: rgba(255,255,255,0.28); }
.fnode.add .fcard { filter: none; }
.fnode.add .add-in {
  position: absolute; inset: 26px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7rem;
  color: rgba(255,255,255,0.7); font-size: 0.95rem;
}
.fnode.add .add-in span:first-child {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.25); background: var(--glass-folder);
}
.fnode.add:hover .add-in { color: #fff; }
.proj-bar { width: 200px; }
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-list button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 14px; text-align: left; font-size: 0.92rem;
}
.menu-list button:hover { background: rgba(255,255,255,0.06); }
.menu-list button svg { color: rgba(255,255,255,0.6); }
.menu-list button.danger { color: #fca5a5; }
.menu-list button.danger svg { color: #fca5a5; }
:root[data-theme="light"] .menu-list button:hover { background: rgba(11,18,32,0.04); }
:root[data-theme="light"] .fnode.add .add-in { color: var(--color-mid); }

/* ============================================================
   ПРОГРЕСС
   ============================================================ */
.prog-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; margin-bottom: 1.25rem; }
.prog-grid .panel { min-width: 0; }

/* График активности: одна серия, тонкие столбики, скругление 4px сверху */
.chart { position: relative; }
.chart-plot {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 10px;
  height: 220px; padding: 0 4px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.chart-grid { position: absolute; inset: 0 0 0 0; pointer-events: none; }
.chart-grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,0.08); }
.chart-grid b { position: absolute; left: 0; transform: translateY(-120%); font-size: 0.7rem; font-weight: 400; color: rgba(255,255,255,0.4); }
.bar-hit { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bar {
  width: min(28px, 70%);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #c4b5fd, #8b6cff);
  transition: filter 0.15s;
  transform-origin: bottom;
  animation: bar-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bar-hit:hover .bar, .bar-hit:focus-visible .bar { filter: brightness(1.2); }
.bar.top { background: linear-gradient(180deg, #ffffff, #a78bfa); box-shadow: 0 0 18px rgba(167,139,250,0.55); }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; padding: 8px 4px 0; }
.chart-x span { text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none;
  padding: 0.4rem 0.75rem; border-radius: 12px;
  background: #1A1726; border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  font-size: 0.8rem; white-space: nowrap;
  translate: -50% -100%;
}
.chart-tip b { font-weight: 500; }
.chart-sum { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.1rem; }
.chart-sum div { font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.chart-sum b { display: block; font-size: 1.6rem; font-weight: 300; color: var(--color-text); }
:root[data-theme="light"] .chart-plot { border-bottom-color: var(--color-border); }
:root[data-theme="light"] .chart-grid i { border-top-color: rgba(11,18,32,0.08); }
:root[data-theme="light"] .chart-grid b, :root[data-theme="light"] .chart-x span, :root[data-theme="light"] .chart-sum div { color: var(--color-mid); }
:root[data-theme="light"] .chart-tip { background: #fff; border-color: var(--color-border); }

/* Кольцо уровня */
.level { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; }
.ring { position: relative; width: 180px; height: 180px; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: rgba(255,255,255,0.08); }
.ring .val { stroke: url(#ring-grad); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-in b { font-size: 3rem; font-weight: 300; line-height: 1; }
.ring-in span { font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.level p { margin: 0; font-size: 0.88rem; color: rgba(255,255,255,0.65); }
:root[data-theme="light"] .ring .track { stroke: rgba(11,18,32,0.08); }
:root[data-theme="light"] .ring-in span, :root[data-theme="light"] .level p { color: var(--color-mid); }

/* Сертификаты */
.cert {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  width: 100%; padding: 12px 0; text-align: left;
}
.cert + .cert { border-top: 1px solid rgba(255,255,255,0.08); }
.cert b { display: block; font-weight: 500; }
.cert span span { font-size: 0.8rem; color: rgba(255,255,255,0.55); }
.cert.locked { opacity: 0.5; cursor: not-allowed; }
.cert-view {
  aspect-ratio: 1.414 / 1;
  border-radius: 24px; padding: 8% 9%;
  background:
    radial-gradient(70% 60% at 85% 0%, rgba(167,139,250,0.35), transparent 60%),
    linear-gradient(150deg, #1d1830, #120f1d);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
}
.cert-view small { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: #c4b5fd; }
.cert-view h4 { margin: 0.4rem 0 0; font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 500; }
.cert-view p { margin: 0.3rem 0 0; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.cert-view footer { display: flex; justify-content: space-between; align-items: flex-end; font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.cert-view footer .brand-logo { width: 34px; height: 34px; }
.cert-view footer .brand-logo svg { width: 18px; height: 18px; }

/* Достижения */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.badge-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem;
  padding: 20px 14px; border-radius: 30px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
}
.badge-card .b-ic {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(167,139,250,0.35), rgba(109,74,255,0.08));
  border: 1px solid rgba(167,139,250,0.5);
  color: #e9e3ff;
  box-shadow: 0 0 22px rgba(124,92,255,0.35);
}
.badge-card b { font-weight: 500; font-size: 0.92rem; }
.badge-card span { font-size: 0.78rem; color: rgba(255,255,255,0.55); }
.badge-card.off { opacity: 0.45; }
.badge-card.off .b-ic { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.2); box-shadow: none; color: rgba(255,255,255,0.6); }
:root[data-theme="light"] .badge-card { background: #fff; border-color: var(--color-border); }
:root[data-theme="light"] .badge-card span, :root[data-theme="light"] .cert span span { color: var(--color-mid); }
:root[data-theme="light"] .badge-card .b-ic { color: var(--color-accent); }

/* ============================================================
   НАСТРОЙКИ
   ============================================================ */
.set-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.set-nav { position: sticky; top: 1rem; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.set-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 18px;
  color: rgba(255,255,255,0.72); font-size: 0.93rem; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.set-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.set-nav a.on { background: rgba(124,92,255,0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(167,139,250,0.4); }
.set-sections { display: flex; flex-direction: column; gap: 1.25rem; }
.set-sec { padding: 28px 30px 26px; scroll-margin-top: 1rem; }
.set-sec > h3 { margin: 0 0 0.3rem; font-size: 1.25rem; font-weight: 500; }
.set-sec > p { margin: 0 0 1.2rem; font-size: 0.88rem; color: rgba(255,255,255,0.55); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 14px 0;
}
.set-row + .set-row { border-top: 1px solid rgba(255,255,255,0.08); }
.set-row b { display: block; font-weight: 400; font-size: 0.97rem; }
.set-row span span { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
.set-profile { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.2rem; }
.set-ava {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--gradient-accent); color: #fff; font-size: 1.9rem; font-weight: 600;
  box-shadow: 0 10px 30px var(--color-accent-glow);
}
.set-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
:root[data-theme="light"] .set-nav a { color: var(--color-mid); }
:root[data-theme="light"] .set-nav a:hover, :root[data-theme="light"] .set-nav a.on { color: var(--color-text); background: rgba(109,74,255,0.08); }
:root[data-theme="light"] .set-row + .set-row { border-top-color: var(--color-border); }
:root[data-theme="light"] .set-sec > p, :root[data-theme="light"] .set-row span span { color: var(--color-mid); }

/* ============================================================
   СОЗДАТЬ С ИИ — мастер в новом стекле
   ============================================================ */
.pg-build .wz-shell { max-width: 820px; }
.pg-build .wz-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.pg-build .wz-step { margin: 0; font-size: 0.9rem; color: rgba(255,255,255,0.6); }
.pg-build .wz-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; height: auto; background: none; margin-bottom: 1.5rem; border-radius: 0; overflow: visible; }
.pg-build .wz-bar i { display: block; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.10); overflow: hidden; }
.pg-build .wz-bar i b { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #a78bfa, #c4b5fd); transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.pg-build .wz-card {
  padding: clamp(24px, 4vw, 40px);
  border-radius: 40px;
  background:
    radial-gradient(90% 60% at 30% 120%, rgba(109,74,255,0.28) 0%, transparent 70%),
    var(--glass-folder);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 18px 40px rgba(0,0,0,0.30);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.pg-build .wz-q { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 500; letter-spacing: -0.01em; }
.pg-build .wz-hint { color: rgba(255,255,255,0.6); }
.pg-build .wz-opt {
  padding: 0.7rem 1.2rem; border-radius: 999px;
  background: var(--glass-folder); border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.93rem;
}
.pg-build .wz-opt:hover { border-color: rgba(255,255,255,0.4); }
.pg-build .wz-opt[aria-pressed="true"] { background: var(--gradient-accent); border-color: transparent; box-shadow: 0 8px 24px var(--color-accent-glow); }
.pg-build .wz-input { border-radius: 22px; background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.18); padding: 1rem 1.2rem; }
.pg-build .wz-next { border-radius: 999px; padding: 0.95rem; border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 10px 30px var(--color-accent-glow), inset 0 1px 0 rgba(255,255,255,0.3); }
.pg-build .wz-back { border-radius: 999px; padding: 0.95rem 1.5rem; background: var(--glass-folder); border-color: rgba(255,255,255,0.2); color: var(--color-text); }
.pg-build .plan-file { border-bottom-color: rgba(255,255,255,0.1); align-items: center; }
.pg-build .plan-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.04);
}
.pg-build .wz-publish { border-radius: 26px; background: rgba(124,92,255,0.12); border: 1px solid rgba(167,139,250,0.35); padding: 1.2rem 1.4rem; }
.pg-build .wz-summary { border-radius: 18px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); padding: 0.8rem 1rem; }
:root[data-theme="light"] .pg-build .wz-opt, :root[data-theme="light"] .pg-build .wz-back { background: rgba(255,255,255,0.85); border-color: var(--color-border); }
:root[data-theme="light"] .pg-build .wz-card {
  background: radial-gradient(90% 60% at 30% 120%, rgba(109,74,255,0.10) 0%, transparent 70%), linear-gradient(150deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
  border-color: rgba(11,18,32,0.10);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 1100px) {
  .learn-grid, .prog-grid { grid-template-columns: minmax(0, 1fr); }
  .lessons { position: static; }
}
@media (max-width: 1000px) {
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; border-radius: 999px; padding: 6px; scrollbar-width: none; -ms-overflow-style: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav a { white-space: nowrap; padding: 9px 14px; }
}
@media (max-width: 680px) {
  .page-head { margin-top: 0.25rem; }
  /* В настройках подпись и переключатель в столбик: рядом они сжимаются
     до двух слов в строке */
  .set-row { flex-direction: column; align-items: stretch; gap: 0.7rem; }
  .set-row .ui-seg { align-self: flex-start; }
  .set-row .ui-switch { align-self: flex-start; }
  .set-row .ui-btn { width: 100%; }
  .panel-head { flex-wrap: wrap; }
  .chart-sum { gap: 1.25rem; }
  .chart-sum div { min-width: 44%; }
  .page-actions, .page-actions .cta { width: 100%; }
  .page-actions .cta { justify-content: center; }
  .course-card { grid-template-columns: 44px minmax(0, 1fr); padding: 18px; }
  .course-card .c-ic { width: 44px; height: 44px; }
  .course-card .cc-count { grid-column: 2; padding: 0; }
  .lessons, .set-sec { padding: 22px 20px; }
  .task-grid { grid-template-columns: minmax(0, 1fr); }
  .proj-grid { grid-template-columns: 248px; justify-content: center; }
  .set-fields { grid-template-columns: 1fr; }
  .set-row { align-items: flex-start; }
  .chart-plot { height: 180px; gap: 6px; }
}

/* В проектах подпись («вчера», «5 дней назад») — под названием, чтобы не
   наезжать на крупный процент внизу карточки */
.proj-grid .fcard-meta { left: 28px; right: auto; top: 112px; bottom: auto; font-size: 13px; }

.set-hint { display: block; font-size: 0.85rem; color: rgba(255,255,255,0.55); }
:root[data-theme="light"] .set-hint { color: var(--color-mid); }

/* ── Пустые состояния: когда у ученика ещё нет данных ── */
.panel-empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 1.75rem 1rem; text-align: center;
  color: rgba(255,255,255,0.55);
}
.panel-empty svg { color: rgba(255,255,255,0.35); margin-bottom: 0.2rem; }
.panel-empty b { font-weight: 500; color: rgba(255,255,255,0.8); }
.panel-empty span { font-size: 0.85rem; }
.nt-empty {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1.5rem 1rem; text-align: center; font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}
.nt-empty svg { color: rgba(255,255,255,0.35); }
/* Подсказка «Что дальше» — ссылка, но выглядит как строка совета */
a.rec { text-decoration: none; color: inherit; border-radius: 18px; transition: background 0.15s; }
a.rec:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.rec .txt b { font-weight: 500; color: var(--color-text); }

/* ============================================================
   СТРАНИЦА УРОКА
   ============================================================ */
.lesson-page { max-width: 860px; margin: 0 auto; padding-bottom: 2rem; }
.lesson-top { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin: 0.5rem 0 1.5rem; }
.lesson-top .cta-ghost svg { transform: rotate(180deg); }
.lesson-meta { font-size: 0.88rem; color: rgba(255,255,255,0.55); }
.lesson-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.5rem; }
.lesson-head h1 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 500; letter-spacing: -0.02em; }
.lesson-head p { margin: 0.2rem 0 0; font-size: 0.92rem; color: rgba(255,255,255,0.55); }
.lesson-block { padding: 26px 30px 28px; margin-bottom: 1.25rem; }
.lesson-block > h2 { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 500; color: rgba(255,255,255,0.7); }
.lesson-note { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 3rem 2rem; }
.lesson-note h1 { margin: 0; font-size: 1.5rem; font-weight: 500; }
.lesson-note p { margin: 0 0 1rem; color: rgba(255,255,255,0.6); }
.lesson-actions { display: flex; justify-content: center; padding: 0.5rem 0 1rem; }

/* Разметка теории */
.md p { margin: 0 0 0.9rem; line-height: 1.65; color: rgba(255,255,255,0.82); }
.md p:last-child { margin-bottom: 0; }
.md strong { color: var(--color-text); font-weight: 600; }
.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em; padding: 0.1rem 0.35rem; border-radius: 6px;
  background: rgba(167,139,250,0.14); color: #ddd2ff;
}
.md-code, .md-out {
  margin: 0 0 1rem; padding: 16px 18px; border-radius: 18px; overflow-x: auto;
  background: rgba(10,9,18,0.55); border: 1px solid rgba(255,255,255,0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem; line-height: 1.55; color: #e7e2ff;
}
.md-code code, .md-out code { background: none; padding: 0; color: inherit; font-size: inherit; }
.md-out { background: rgba(74,222,128,0.07); border-color: rgba(74,222,128,0.25); color: #d6f5e2; }
.md-h { margin: 1.6rem 0 0.7rem; font-weight: 500; letter-spacing: -0.01em; color: #fff; }
h3.md-h { font-size: 1.12rem; }
h4.md-h { font-size: 1rem; color: rgba(255,255,255,0.9); }
.md > .md-h:first-child { margin-top: 0; }
.md-quote {
  margin: 0 0 1rem; padding: 12px 18px; border-left: 3px solid #a78bfa;
  border-radius: 0 14px 14px 0; background: rgba(167,139,250,0.08);
  color: rgba(255,255,255,0.88); line-height: 1.6;
}
.md-list { margin: 0 0 1rem; padding-left: 1.2rem; }
.md-list li { margin-bottom: 0.45rem; line-height: 1.6; color: rgba(255,255,255,0.82); }
.md-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.md-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.md-table th, .md-table td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.md-table th { color: rgba(255,255,255,0.55); font-weight: 400; }

/* Примеры */
.example { margin-bottom: 1.5rem; }
.example:last-child { margin-bottom: 0; }
.example-label { display: block; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 0.4rem; }
.example-explain { margin: 0; font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.55; }

/* Тест */
.quiz-q { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.quiz-question p { margin-bottom: 0.7rem; font-weight: 500; color: var(--color-text); }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 16px; border-radius: 18px; font-size: 0.95rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.15s, background 0.15s;
}
.quiz-opt i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.quiz-opt:hover:not(:disabled) { border-color: rgba(167,139,250,0.5); }
.quiz-opt[aria-checked="true"] { border-color: rgba(167,139,250,0.7); background: rgba(124,92,255,0.12); }
.quiz-opt[aria-checked="true"] i { border-color: #a78bfa; background: #a78bfa; box-shadow: inset 0 0 0 3px rgba(10,9,18,0.8); }
.quiz-opt.right { border-color: rgba(74,222,128,0.6); background: rgba(74,222,128,0.12); }
.quiz-opt.right i { border-color: #4ade80; background: #4ade80; }
.quiz-opt.wrong { border-color: rgba(248,113,113,0.6); background: rgba(248,113,113,0.10); }
.quiz-opt.wrong i { border-color: #f87171; background: #f87171; }
.quiz-opt:disabled { cursor: default; }
.quiz-explain { margin: 0.7rem 0 0; font-size: 0.88rem; line-height: 1.55; color: rgba(255,255,255,0.7); }
.quiz-explain.ok b { color: #4ade80; }
.quiz-explain.no b { color: #fca5a5; }
.quiz-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.quiz-score { font-size: 0.92rem; color: rgba(255,255,255,0.7); }

/* Задачи урока */
.task-block { padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.task-block:last-child { border-bottom: none; padding-bottom: 0; }
.task-block > b { display: block; font-weight: 500; margin-bottom: 0.6rem; color: #c4b5fd; }
.task-block .faq { margin: 0 0 0.9rem; }
.task-note { margin: 0; font-size: 0.9rem; color: rgba(255,255,255,0.6); }
.task-solved { margin-left: 0.4rem; vertical-align: middle; }
.code-input {
  display: block; width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 7.5rem; margin: 0 0 0.9rem; padding: 16px 18px; border-radius: 18px;
  background: rgba(10,9,18,0.55); border: 1px solid rgba(255,255,255,0.14);
  color: #e7e2ff; caret-color: #a78bfa; tab-size: 4;
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.code-input:focus { outline: none; border-color: rgba(167,139,250,0.6); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); }
.task-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.task-result:empty { display: none; }
.task-result { margin-top: 1rem; }
.task-status { margin: 0 0 0.8rem; font-size: 0.95rem; color: rgba(255,255,255,0.75); }
.task-status.ok { color: #4ade80; }
.task-status.no { color: #fca5a5; }
.task-fail { margin-bottom: 0.9rem; }
.task-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.task-diff .md-out, .task-fail .md-out { margin: 0; white-space: pre-wrap; word-break: break-word; }
.md-out.err { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.3); color: #fde2e2; }
@media (max-width: 680px) { .task-diff { grid-template-columns: 1fr; } }

@media (max-width: 680px) {
  .lesson-block { padding: 22px 20px; }
  .lesson-head h1 { font-size: 1.45rem; }
}

/* ── Битва (battle.html) ── */
.battle-link {
  display: flex; align-items: center; gap: 0.9rem; margin: 0 0 1rem; padding: 14px 18px; border-radius: 22px;
  background: radial-gradient(90% 90% at 0% 0%, rgba(124,92,255,0.28), transparent 70%), rgba(255,255,255,0.05);
  border: 1px solid rgba(167,139,250,0.4); color: inherit; text-decoration: none;
}
.battle-link:hover { border-color: rgba(167,139,250,0.75); }
.battle-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.battle-link b { font-weight: 500; }
.battle-link span span { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.bl-ic { font-size: 1.6rem; }
.b-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.b-stat { padding: 12px 14px; border-radius: 20px; background: var(--glass-folder, rgba(255,255,255,0.08)); border: 1px solid rgba(255,255,255,0.16); display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.b-stat > span { font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.5); }
.b-stat > b { font-size: 1.35rem; font-weight: 300; }
.b-stat .b-rank { font-size: 1rem; font-weight: 500; }
.b-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.b-bar em { display: block; height: 100%; border-radius: 3px; transition: width 0.4s; }
.b-bar.hp em { background: linear-gradient(90deg, #f87171, #fca5a5); }
.b-bar.xp em { background: linear-gradient(90deg, #7c5cff, #4ade80); }
.b-flame, .b-sub { font-style: normal; font-size: 0.78rem; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-rank { color: #c4b5fd; }
.b-fight.boss { border-color: rgba(248,113,113,0.45); box-shadow: 0 0 40px rgba(248,113,113,0.12); }
.b-enemy { font-size: 3.2rem; text-align: center; line-height: 1.2; }
.b-fight.boss .b-enemy { font-size: 4.2rem; }
.b-enemy-name { text-align: center; color: #fca5a5; font-size: 0.9rem; margin-bottom: 0.8rem; }
.b-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.b-screen { text-align: center; }
.b-screen h1 { font-size: 1.6rem; font-weight: 500; margin: 0.4rem 0 0.8rem; }
.b-big { font-size: 3.6rem; }
.b-rules { list-style: none; padding: 0; margin: 1rem auto; max-width: 460px; text-align: left; display: grid; gap: 0.45rem; color: rgba(255,255,255,0.8); }
.b-me { color: rgba(255,255,255,0.7); }
.b-promo { color: #fbbf24; font-weight: 500; }
.b-hint { color: rgba(255,255,255,0.6); font-size: 0.92rem; }
@media (max-width: 680px) {
  .b-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-enemy { font-size: 2.6rem; }
}
:root[data-theme="light"] .battle-link span span, :root[data-theme="light"] .b-stat > span,
:root[data-theme="light"] .b-flame, :root[data-theme="light"] .b-sub, :root[data-theme="light"] .b-me,
:root[data-theme="light"] .b-hint, :root[data-theme="light"] .b-rules { color: var(--lt-mid, #5D5A75); }
:root[data-theme="light"] .b-stat { background: rgba(255,255,255,0.85); border-color: var(--lt-line-2, rgba(23,20,43,0.1)); }
:root[data-theme="light"] .b-rank { color: #5B3FD6; }
:root[data-theme="light"] .b-enemy-name { color: #DC2626; }

/* Поле задания в виде редактора CodeMirror (js/lesson.js) — тот же вид, что у textarea */
.task-block .CodeMirror {
  height: auto;
  min-height: 7.5rem;
  margin: 0 0 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
}
.task-block .CodeMirror-focused { border-color: rgba(167,139,250,0.6); box-shadow: 0 0 0 3px rgba(124,92,255,0.18); }
.task-block .CodeMirror-scroll { min-height: 7.5rem; }
.task-block .CodeMirror-gutters { border-right: 0; }
:root[data-theme="light"] .task-block .CodeMirror { border-color: var(--lt-line-2); }
