
.lesson-wrap { max-width: 820px; margin: 0 auto; padding: 32px 20px 80px; }
.lesson-head { margin-bottom: 32px; }
.lesson-head h1 {
  font-size: clamp(26px, 4.5vw, 36px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.15; margin-bottom: 14px;
}
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13px; color: var(--muted); }
.lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lesson-meta .dot { color: var(--muted-2); }
.lesson-toc {
  padding: 18px 22px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 36px;
}
.lesson-toc h2 {
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px;
}
.lesson-toc ol { list-style: none; counter-reset: toc; display: grid; gap: 6px; }
.lesson-toc li { counter-increment: toc; }
.lesson-toc a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  display: flex; gap: 10px; align-items: baseline; padding: 4px 0; transition: color .15s;
}
.lesson-toc a::before {
  content: counter(toc) "."; color: var(--accent);
  font-family: var(--mono); font-size: 12px; min-width: 20px;
}
.lesson-toc a:hover { color: var(--text); }
.lesson-section { margin-bottom: 44px; scroll-margin-top: 88px; }
.lesson-section > h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  padding-bottom: 12px; margin-bottom: 20px;
  border-bottom: 2px solid var(--border); position: relative;
}
.lesson-section > h2::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 60px; height: 2px; background: var(--accent);
}
.lesson-section > h3 { font-size: 17px; font-weight: 600; margin: 26px 0 12px; color: var(--text); }
.lesson-section > h4 { font-size: 15px; font-weight: 600; margin: 20px 0 10px; color: var(--text-dim); }
.lesson-section p { color: #cdd3e0; font-size: 15.5px; line-height: 1.75; margin-bottom: 14px; }
.lesson-section p strong { color: var(--text); font-weight: 600; }
.lesson-section p em { color: var(--accent); font-style: normal; font-weight: 500; }
.lesson-section ul, .lesson-section ol { margin: 0 0 16px; padding-left: 0; list-style: none; }
.lesson-section ol { counter-reset: item; }
.lesson-section ul li, .lesson-section ol li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  font-size: 15px; line-height: 1.7; color: #cdd3e0;
}
.lesson-section ul li::before {
  content: ''; position: absolute; left: 8px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.lesson-section ol li { counter-increment: item; }
.lesson-section ol li::before {
  content: counter(item) "."; position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--accent); min-width: 20px;
}
.lesson-section li strong { color: var(--text); font-weight: 600; }
.callout {
  display: flex; gap: 14px; padding: 16px 18px;
  background: rgba(106,169,255,.06); border: 1px solid rgba(106,169,255,.2);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  margin: 20px 0; font-size: 14.5px; line-height: 1.7; color: #cdd3e0;
}
.callout-icon { flex-shrink: 0; font-size: 20px; line-height: 1.3; }
.callout-title { display: block; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.callout.warn { background: rgba(255,216,102,.06); border-color: rgba(255,216,102,.25); border-left-color: var(--warn); }
.callout.warn .callout-icon { color: var(--warn); }
.callout.ok { background: rgba(74,222,128,.06); border-color: rgba(74,222,128,.25); border-left-color: var(--ok); }
.checklist {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 22px 0;
}
.checklist h4 {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px;
}
.checklist ol { list-style: none; counter-reset: chk; padding: 0; margin: 0; }
.checklist li {
  counter-increment: chk; position: relative;
  padding: 8px 0 8px 40px; font-size: 14.5px; color: #cdd3e0;
  line-height: 1.6; border-bottom: 1px solid #1a1e27;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: '☐'; position: absolute; left: 0; top: 6px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--accent); border: 1px solid var(--border-hi);
  border-radius: 6px; background: var(--bg-alt);
}
.qa-list { display: grid; gap: 14px; margin: 20px 0; }
.qa-item { padding: 16px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qa-q { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; gap: 10px; }
.qa-q::before {
  content: 'Q'; flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 6px; background: rgba(106,169,255,.15); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.qa-a { font-size: 14px; color: var(--muted); line-height: 1.7; padding-left: 32px; }
@media (max-width: 600px) {
  .lesson-wrap { padding: 20px 14px 60px; }
  .lesson-section p, .lesson-section li { font-size: 15px; }
}
/* Контейнер вокруг iframe: белый фон, скруглённые углы, тень */
.homework-form {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  /* Небольшой отступ, чтобы iframe не упирался в края */
  padding: 0;
}

.homework-form iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #ffffff;
  /* Заставляем iframe использовать светлую схему */
  color-scheme: light;
}

/* Если сайт поддерживает тёмную тему и у контейнера появится тёмный фон -
   принудительно делаем светлым именно для этого блока */
.homework-form {
  color-scheme: light;
}

/* На узких экранах уменьшаем высоту, чтобы форма не была слишком длинной */
@media (max-width: 600px) {
  .homework-form iframe {
    height: 900px; /* На мобильных элементы крупнее, нужно больше места */
  }
}
/* Компонент формы домашнего задания */
.homework-form {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  color-scheme: light;
}
.homework-form iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #ffffff;
  color-scheme: light;
}
@media (max-width: 600px) {
  .homework-form iframe { height: 900px; }
}/* ── Прикрепить домашнее задание ── */
.hw-attach {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.hw-attach-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: #fff;
  background: var(--accent-hi);
  border: 1px solid var(--accent-hi);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.hw-attach-btn:hover { background: var(--accent); border-color: var(--accent); }
.hw-attach-btn:active { transform: translateY(1px); }
.hw-attach-btn.active {
  background: var(--bg-alt);
  border-color: var(--border-hi);
  color: var(--muted);
}

.hw-attach-frame {
  margin-top: 16px;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  overflow: hidden;
  color-scheme: light;
  animation: hwAttachIn .25s ease;
}
.hw-attach-frame.hidden { display: none; }
.hw-attach-frame iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #ffffff;
}

@keyframes hwAttachIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .hw-attach { padding: 14px; }
  .hw-attach-btn { width: 100%; justify-content: center; }
  .hw-attach-frame iframe { height: 720px; }
}