/* Образование для себя — раздел обучения (страницы курса) */

body.learn { background-image: none; background-color: var(--paper); }
.learn [hidden] { display: none !important; }

/* ---------- Верхняя полоса ---------- */

.lbar { background: var(--ink); color: var(--cream); --focus: #fff; }
.lbar__in {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  min-height: 60px;
  padding-inline: clamp(16px, 3vw, 32px);
}
.lbar .brand { color: var(--cream); font-size: 1.05rem; }
.lbar .brand__mark { height: 22px; border-bottom-color: var(--cream); }
.lbar .brand__mark i:nth-child(1) { height: 16px; background: #4fc0ae; }
.lbar .brand__mark i:nth-child(2) { height: 19px; background: #9da1f2; }
.lbar .brand__mark i:nth-child(3) { height: 14px; }
.lbar__course {
  flex: 1;
  min-width: 0;
  font: 500 0.95rem/1.3 var(--sans);
  color: #c3cdc7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lbar__course a { text-decoration: none; }
.lbar__course a:hover { color: #fff; }
.lbar__prog { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; white-space: nowrap; }
.meter { width: 120px; height: 6px; border-radius: 3px; background: #33443e; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ind); border-radius: 3px; transition: width 0.3s; }
.lbar__menu {
  display: none;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid #4a5d56;
  border-radius: 999px;
  background: none;
  color: var(--cream);
  font: 500 0.9rem/1 var(--sans);
  cursor: pointer;
}

/* ---------- Каркас ---------- */

.lwrap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  max-width: 1320px;
  margin-inline: auto;
}

.side {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 26px 14px 40px clamp(16px, 3vw, 32px);
  font-size: 0.93rem;
  scrollbar-width: thin;
}
.side__home { display: block; padding: 8px 10px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.side__home:hover { background: #fff; }
.side details { margin-top: 4px; }
.side summary {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  line-height: 1.3;
}
.side summary::-webkit-details-marker { display: none; }
.side summary:hover { background: #fff; }
.side summary b { font: italic 500 1.05rem/1 var(--serif); color: var(--med); }
.side ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 34px; }
.side li a {
  position: relative;
  display: block;
  padding: 6px 10px 6px 20px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
}
.side li a::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #a9b4ad;
}
.side li a.is-done::before { background: var(--med); border-color: var(--med); }
.side li a:hover { background: #fff; color: var(--ink); }
.side li a[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 600; }
.side li a.side__sp { color: var(--ink); }
.side__sep { height: 1px; margin: 12px 10px; background: var(--line); }

.main { min-width: 0; padding: clamp(24px, 4vw, 52px) clamp(16px, 4vw, 56px) 80px; background: var(--sheet); min-height: 100vh; }
.article { max-width: 46rem; margin-inline: auto; }
.article--wide { max-width: 58rem; }

/* ---------- Текст урока ---------- */

.eyebrow { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.9rem; color: var(--muted); }
.eyebrow b { color: var(--med); font-weight: 600; }
.article h1 { margin-top: 12px; font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.08; }
.article h2 { margin-top: 2.2em; font-size: clamp(1.35rem, 2.2vw, 1.65rem); font-weight: 600; }
.article h3 { margin-top: 1.8em; font-size: 1.18rem; }
.article h4 { margin-top: 1.4em; font: 600 1.02rem/1.3 var(--sans); }
.article p, .article ul, .article ol { margin-top: 1em; font-size: 1.05rem; line-height: 1.65; }
.article h1 + p { margin-top: 1.4em; }
.article ul, .article ol { padding-left: 1.35em; }
.article li + li { margin-top: 0.4em; }
.article li > p { margin-top: 0.4em; }
.article li::marker { color: var(--med); font-weight: 600; }
.article strong { font-weight: 600; }
.article code { font: 500 0.92em/1.4 ui-monospace, Consolas, monospace; background: var(--paper); padding: 2px 6px; border-radius: 5px; }
.article sup { font-size: 0.7em; }
.lead { font-size: 1.18rem !important; color: var(--muted); }

.tbl { margin-top: 1.2em; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 0.93rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.tbl thead th { border-top: 0; background: var(--paper); font-weight: 600; font-size: 0.88rem; }
.tbl td:first-child, .tbl th:first-child { min-width: 9em; }
.tbl tr:has(td strong:only-child) td { background: #f7f9f6; }

/* выноски */
.call { margin-top: 1.5em; padding: 18px 22px 20px; border-radius: 14px; background: var(--paper); }
.call > :nth-child(2) { margin-top: 0.5em; }
.call p, .call ul, .call ol { font-size: 1rem; }
.call__label { margin: 0 !important; font: 600 0.84rem/1.2 var(--sans) !important; color: var(--med-3); }
.call--key { background: var(--med-t); border-left: 5px solid var(--med); border-radius: 4px 14px 14px 4px; }
.call--example { background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 30px -24px rgba(19, 32, 27, 0.5); }
.call--example .call__label { color: #2a2f8f; }
.call--example .tbl { border-radius: 8px; }
.call--warn { background: var(--ind-t); }
.call--warn .call__label { color: #6a4806; }
.call--formula { background: var(--ink); color: var(--cream); }
.call--formula .call__label { color: var(--gold); }
.call--formula p { font: 400 1.08rem/1.5 var(--serif); }
.call--formula strong { color: #fff; }
.call--do { background: var(--edu-t); }
.call--do .call__label { color: #2a2f8f; }
.call--law { background: #fff; border: 1px dashed #9aa59f; }
.call--law .call__label { color: var(--muted); }
.call--law p { font-size: 0.95rem; }

/* низ страницы */
.done { margin-top: 3em; padding-top: 1.6em; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.done__note { font-size: 0.93rem; color: var(--muted); margin: 0 !important; }
.btn.is-on { background: var(--med); border-color: var(--med); }
.pager { margin-top: 2em; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color 0.15s, background-color 0.15s; }
.pager a:hover { border-color: var(--ink); background: var(--paper); }
.pager small { display: block; font-size: 0.84rem; color: var(--muted); }
.pager b { display: block; margin-top: 2px; font: 600 1.02rem/1.3 var(--serif); }
.pager__next { text-align: right; grid-column: 2; }

/* ---------- Главная курса ---------- */

.chead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--paper); }
.ring .fg { stroke: var(--med); stroke-linecap: round; transition: stroke-dashoffset 0.4s; }
.ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font: 600 1.7rem/1 var(--serif); }
.ring small { display: block; margin-top: 4px; font: 400 0.76rem/1.2 var(--sans); color: var(--muted); }
.resume { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

.mods { list-style: none; margin: 40px 0 0 !important; padding: 0 !important; display: grid; gap: 14px; }
.mod { margin: 0 !important; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px 20px; align-items: start; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; }
.mod__n { font: italic 500 2.6rem/0.9 var(--serif); color: var(--med); }
.mod h2 { margin: 0; font-size: 1.32rem; }
.mod h2 a { text-decoration: none; }
.mod h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.mod p { margin: 6px 0 0; font-size: 0.97rem; line-height: 1.5; color: var(--muted); }
.mod__meta { margin-top: 12px !important; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--paper); font-size: 0.84rem; color: var(--ink); white-space: nowrap; }
.chip.is-ok { background: var(--med-t); color: var(--med-3); font-weight: 600; }
.mod__state { font-size: 0.88rem; color: var(--muted); white-space: nowrap; text-align: right; }
.mod__state b { display: block; font: 600 1.2rem/1 var(--serif); color: var(--ink); }

/* ---------- Карточки ---------- */

.must { list-style: none; margin: 1.2em 0 0; padding: 0 !important; border-top: 1px solid var(--line); }
.must li { margin: 0 !important; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 6px 24px; }
.must b { font: 600 1.05rem/1.35 var(--serif); }
.must span { font-size: 0.99rem; line-height: 1.55; }

.cards { margin-top: 1.5em; }
.fc { position: relative; min-height: 250px; perspective: 1200px; cursor: pointer; border: 0; padding: 0; background: none; width: 100%; text-align: left; color: inherit; font: inherit; display: block; }
.fc__in { display: block; position: relative; min-height: 250px; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1); }
.fc.is-flip .fc__in { transform: rotateY(180deg); }
.fc__side { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 28px clamp(20px, 4vw, 44px); border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc__front { background: var(--med-3); color: var(--cream); }
.fc__front b { font: 500 clamp(1.5rem, 3.4vw, 2.2rem) / 1.12 var(--serif); }
.fc__back { background: var(--med-t); transform: rotateY(180deg); font-size: 1.1rem; line-height: 1.55; }
.fc small { margin-top: 18px; font-size: 0.86rem; opacity: 0.8; }
.cards__bar { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cards__count { margin-right: auto; font-size: 0.93rem; color: var(--muted); }

/* ---------- Тест ---------- */

.quiz { margin-top: 1.5em; }
.q { margin: 0 0 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.q legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font: 600 1.12rem/1.35 var(--serif); }
.q legend + * { clear: both; }
.q__hint { margin: 0 0 10px !important; font-size: 0.88rem !important; color: var(--muted); clear: both; }
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 11px 14px; margin-top: 6px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 1rem; line-height: 1.45; transition: border-color 0.12s, background-color 0.12s; }
.opt:hover { border-color: #8d9a93; }
.opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.opt:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.opt.is-right { border-color: var(--med); background: var(--med-t); }
.opt.is-wrong { border-color: #c0392b; background: #fbeae7; }
.numin { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.numin input, .calc input, .tfield input { width: 12em; max-width: 100%; padding: 11px 13px; border: 1.5px solid #a9b4ad; border-radius: 10px; font: 500 1.02rem/1.3 var(--sans); font-variant-numeric: tabular-nums; background: #fff; color: var(--ink); }
.numin input:focus, .calc input:focus, .tfield input:focus { border-color: var(--ink); }
.numin span { color: var(--muted); }
.q.is-ok { border-color: var(--med); }
.q.is-bad { border-color: #c0392b; }
.q__why { margin: 14px 0 0 !important; padding: 12px 16px; border-radius: 10px; background: var(--paper); font-size: 0.96rem !important; line-height: 1.5 !important; }
.q__why b { color: var(--med-3); }
.q.is-bad .q__why b { color: #a3261a; }
.quiz__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 8px; }
.quiz__msg { font-size: 0.95rem; color: #a3261a; margin: 0 !important; }
.result { margin-top: 20px; padding: 24px 26px; border-radius: 16px; background: var(--ind-t); }
.result.is-pass { background: var(--med-3); color: var(--cream); }
.result b { display: block; font: 500 1.9rem/1.1 var(--serif); }
.result p { margin: 8px 0 0 !important; font-size: 1rem !important; }
.result .btn { margin-top: 16px; }
.result.is-pass .btn { background: var(--cream); border-color: var(--cream); color: var(--ink); }

/* ---------- Задания ---------- */

.task { margin-top: 28px; padding: 26px 28px 28px; border: 1px solid var(--line); border-radius: 18px; }
.task__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.task__kind { font-size: 0.86rem; color: var(--muted); }
.task h3 { margin: 0; font-size: 1.36rem; flex: 1 1 14em; }
.task__ok { display: none; padding: 4px 12px; border-radius: 999px; background: var(--med-t); color: var(--med-3); font-size: 0.86rem; font-weight: 600; }
.task.is-done .task__ok { display: inline-block; }
.task.is-done { border-color: var(--med); }
.tfield { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tfield:first-of-type { margin-top: 18px; }
.tfield label { font-size: 1rem; line-height: 1.4; }
.tfield__in { display: flex; align-items: center; gap: 8px; }
.tfield__in span { min-width: 4.2em; color: var(--muted); font-size: 0.93rem; }
.tfield input.is-ok { border-color: var(--med); background: var(--med-t); }
.tfield input.is-bad { border-color: #c0392b; background: #fbeae7; }
.task__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.task__msg { font-size: 0.95rem; margin: 0 !important; }
.solution { margin-top: 18px; padding: 4px 22px 20px; border-radius: 14px; background: var(--paper); }
.solution[hidden] { display: none; }
.solution p, .solution li { font-size: 0.98rem; }
.solution .tbl { background: #fff; }

.case { padding: 16px 0; border-top: 1px solid var(--line); }
.case:first-of-type { margin-top: 18px; }
.case p { margin: 0 !important; font-size: 1.02rem; }
.case__opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.case__opts button { padding: 8px 14px; border: 1.5px solid #a9b4ad; border-radius: 999px; background: #fff; color: var(--ink); font: 500 0.92rem/1.25 var(--sans); cursor: pointer; text-align: left; transition: border-color 0.12s, background-color 0.12s; }
.case__opts button:hover { border-color: var(--ink); }
.case__opts button.is-right { border-color: var(--med); background: var(--med); color: #fff; }
.case__opts button.is-wrong { border-color: #c0392b; background: #fbeae7; color: #a3261a; text-decoration: line-through; }
.case__why { margin-top: 10px !important; font-size: 0.95rem !important; color: var(--med-3); }
.case__why.is-bad { color: #a3261a; }

.own label { display: block; margin-top: 18px; font-weight: 500; font-size: 1rem; line-height: 1.4; }
.own textarea { display: block; width: 100%; min-height: 92px; margin-top: 8px; padding: 12px 14px; border: 1.5px solid #a9b4ad; border-radius: 10px; font: 400 1rem/1.5 var(--sans); color: var(--ink); background: #fbfcfa; resize: vertical; }
.own textarea:focus { border-color: var(--ink); background: #fff; }
.checks { list-style: none; margin: 10px 0 0 !important; padding: 0 !important; }
.checks li { margin: 0 !important; }
.checks label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; margin: 0; padding: 8px 0; font-weight: 400; font-size: 0.99rem; cursor: pointer; }
.checks input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--med); }
.task h4 { margin-top: 22px; }
.hintbox { margin-top: 18px; border-radius: 14px; background: var(--paper); }
.hintbox summary { padding: 14px 20px; cursor: pointer; font-weight: 600; font-size: 0.97rem; }
.hintbox > div { padding: 0 20px 18px; }
.hintbox p:first-child { margin-top: 0; }
.saved { font-size: 0.86rem; color: var(--muted); }

.bars { margin-top: 18px; display: grid; gap: 10px; }
.bars div { display: grid; grid-template-columns: 9em minmax(0, 1fr) 3.4em; gap: 12px; align-items: center; font-size: 0.93rem; }
.bars i { display: block; height: 12px; border-radius: 6px; background: var(--med); min-width: 2px; }
.bars div:last-child i { background: var(--ind); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }

/* тренинг */
.train { margin-top: 44px; padding: 30px clamp(20px, 4vw, 36px) 32px; border-radius: 20px; background: var(--med-3); color: var(--cream); }
.train h2 { margin: 6px 0 0 !important; color: #fff; }
.train__label { margin: 0 !important; font: 600 0.86rem/1.2 var(--sans) !important; color: var(--gold); }
.train dl { margin: 20px 0 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px 20px; font-size: 0.98rem; }
.train dt { color: #a9c4bc; }
.train dd { margin: 0; }
.train h3 { color: #fff; }
.train p, .train li { font-size: 1rem !important; }
.train li::marker { color: var(--gold); }
.train a { color: #fff; }
.train .sheet { margin-top: 24px; padding: 6px 24px 22px; border-radius: 14px; background: var(--cream); color: var(--ink); }
.train .sheet h3 { color: var(--ink); }
.train .sheet li::marker { color: var(--med); }
.train .checks label { font-size: 0.98rem; }

/* ---------- Калькуляторы ---------- */

.calc { margin-top: 1.8em; padding: 24px 26px 26px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.calc__title { margin: 0 !important; font: 600 1.25rem/1.25 var(--serif) !important; }
.calc__sub { margin: 4px 0 0 !important; font-size: 0.93rem !important; color: var(--muted); }
.calc__grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }
.calc__grid label { display: block; font-size: 0.9rem; line-height: 1.3; color: #33413b; }
.calc__grid input { display: block; width: 100%; margin-top: 6px; }
.calc__out { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.calc__out div { padding: 14px 16px; border-radius: 12px; background: #fff; }
.calc__out small { display: block; font-size: 0.84rem; color: var(--muted); line-height: 1.3; }
.calc__out b { display: block; margin-top: 4px; font: 600 1.34rem/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.calc__out .is-neg b { color: #a3261a; }
.calc__out .is-pos b { color: var(--med-3); }
.calc__note { margin: 16px 0 0 !important; font-size: 0.97rem !important; }
.calc .tbl { background: #fff; }
.calc .tbl th, .calc .tbl td { text-align: right; }
.calc .tbl th:first-child, .calc .tbl td:first-child { text-align: left; }

/* материалы */
.files { list-style: none; margin: 1.4em 0 0; padding: 0 !important; display: grid; gap: 12px; }
.files li { margin: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; }
.files b { display: block; font: 600 1.12rem/1.3 var(--serif); }
.files span { display: block; margin-top: 4px; font-size: 0.95rem; color: var(--muted); line-height: 1.45; }

/* ---------- Узкие экраны ---------- */

@media (max-width: 1040px) {
  .lwrap { grid-template-columns: minmax(0, 1fr); }
  .lbar__menu { display: inline-flex; }
  .side {
    display: none;
    position: fixed;
    inset: 60px 0 0 0;
    z-index: 20;
    max-height: none;
    padding: 18px 16px 40px;
    background: var(--paper);
  }
  body.menu-open .side { display: block; }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 680px) {
  .lbar__course, .meter { display: none; }
  .lbar__prog { margin-left: auto; }
  .article p, .article ul, .article ol { font-size: 1rem; }
  .chead { grid-template-columns: minmax(0, 1fr); }
  .ring { width: 104px; height: 104px; }
  .mod { grid-template-columns: 44px minmax(0, 1fr); padding: 18px; }
  .mod__n { font-size: 2rem; }
  .mod__state { grid-column: 2; text-align: left; }
  .mod__state b { display: inline; font-size: 1rem; }
  .must li { grid-template-columns: minmax(0, 1fr); }
  .q, .task, .calc { padding: 18px 16px 20px; }
  .tfield { grid-template-columns: minmax(0, 1fr); }
  .tfield input, .numin input { width: 100%; }
  .tfield__in span { min-width: 0; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__next { grid-column: 1; text-align: left; }
  .train dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .train dd { margin-bottom: 10px; }
  .files li { grid-template-columns: minmax(0, 1fr); }
  .bars div { grid-template-columns: 6.5em minmax(0, 1fr) 3em; }
}

@media (prefers-reduced-motion: reduce) {
  .fc__in, .meter i, .ring .fg { transition: none; }
}

@media print {
  .lbar, .side, .pager, .done, .quiz__bar, .task__bar, .cards { display: none !important; }
  .lwrap { display: block; }
  .main { padding: 0; }
  .solution[hidden] { display: block; }
}

/* ---------- Дополнения для курса «Маркетинг в медицине» ---------- */
.article pre { margin-top: 1.1em; padding: 14px 16px; border-radius: 12px; background: #13201b; color: #e9f0ea; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article pre code { display: block; padding: 0; background: none; color: inherit; font: 500 0.86rem/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.call pre { background: #13201b; }
.article ul.task-list { list-style: none; padding-left: 0; }
.article ul.task-list li { position: relative; padding-left: 1.9em; }
.article ul.task-list input[type="checkbox"] { position: absolute; left: 0; top: 0.28em; width: 1.1em; height: 1.1em; margin: 0; accent-color: var(--med); }
.calc__grid input[data-utm] { width: 100%; font-variant-numeric: normal; }
.utm__grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.utm__wide { grid-column: 1 / -1; }
.utm__out { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: #fff; }
.utm__out small { display: block; font-size: 0.84rem; color: var(--muted); }
.utm__out code { display: block; margin-top: 6px; padding: 0; background: none; font: 500 0.9rem/1.55 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; word-break: break-all; }
.utm__bar { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.utm__bar p { margin: 0 !important; font-size: 0.93rem !important; flex: 1 1 260px; color: var(--med-3); }
.utm__bar p.is-warn { color: #8a4b00; }
.calc__cols { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.calc__cols fieldset { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.calc__cols legend { padding: 0 6px; font: 600 0.95rem/1.2 var(--sans); }
.calc__cols label { display: block; margin-top: 10px; font-size: 0.9rem; color: #33413b; }
.calc__cols input { display: block; width: 100%; margin-top: 6px; }
.article :not(pre) > code { overflow-wrap: anywhere; }
.case p, .quiz legend, .quiz label, .task p, .hintbox p { overflow-wrap: anywhere; }

/* модули, которые ещё готовятся */
.mod--soon { background: transparent; border-style: dashed; }
.mod--soon .mod__n, .mod--soon h2 { color: var(--muted); }
.mod--soon .mod__state { font-size: 0.84rem; }

/* диаграмма Ганта */
.gantt { margin: 1.4em 0; overflow-x: auto; }
.gantt svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.gantt figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }

/* панель показателей */
.dash { margin: 1.4em 0; overflow-x: auto; }
.dash svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.dash figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }

/* Оболочка урока по новой визуальной системе. Содержание и поведение прежние. */
body.learn { background: #f7f6f2; }
.lbar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); --focus: #205f43; }
.lbar__in { min-height: 68px; max-width: 1600px; margin-inline: auto; }
.lbar .brand { color: var(--ink); }
.lbar .brand__mark { border-bottom-color: var(--ink); }
.lbar .brand__mark i:nth-child(1), .lbar .brand__mark i:nth-child(2) { background: var(--med-3); }
.lbar .brand__mark i:nth-child(3) { background: #a3b786; }
.lbar__course { color: var(--med-3); }
.lbar__course a:hover { color: var(--ink); text-decoration: underline; }
.lbar__menu { color: var(--ink); border-color: var(--line); }
.meter { background: #dce4dc; }
.meter i { background: var(--med-3); }
.lwrap { max-width: 1600px; grid-template-columns: 288px minmax(0,1fr); gap: 0; }
.lwrap--rail { grid-template-columns: 278px minmax(0,1fr) 248px; }
.side { top: 0; padding: 28px 14px 40px 20px; background: #f7f6f2; border-right: 1px solid var(--line); }
.side__home { color: var(--med-3); }
.side details { margin-top: 8px; }
.side summary { padding: 11px 10px; border-radius: 10px; }
.side details[open] > summary { background: #e5ede5; color: var(--med-3); }
.side li a { min-height: 37px; padding-top: 8px; padding-bottom: 8px; }
.side li a[aria-current="page"] { background: #e5ede5; color: var(--med-3); }
.main { min-height: calc(100vh - 68px); padding: clamp(26px,3vw,48px) clamp(20px,3vw,44px) 80px; background: #fff; }
.article { max-width: 49rem; }
.article--wide { max-width: 61rem; }
.article h1 { font-size: clamp(2rem,3.2vw,3.05rem); letter-spacing: -.035em; }
.article h2 { font-weight: 600; }
.article p, .article ul, .article ol { line-height: 1.7; }
.eyebrow { margin-bottom: 5px; }
.tbl { border-radius: 10px; }
.tbl thead th { background: #e9efe9; color: var(--med-3); }
.call { border-radius: 12px; }
.call--key { border-left-color: var(--med-3); }
.pager a { border-radius: 12px; }
.pager a:hover { background: #e9efe9; border-color: var(--med-3); }
.done { border-color: var(--line); }
.lesson-rail { position: sticky; top: 0; align-self: start; display: grid; gap: 14px; max-height: 100vh; overflow-y: auto; padding: 24px 17px 30px; }
.lesson-rail__card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.lesson-rail__card--soft { background: #e9efe9; }
.lesson-rail h2 { font: 600 1.1rem/1.25 var(--serif); }
.lesson-rail p { margin-top: 12px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.lesson-rail__progress { display: flex; justify-content: space-between; }
.lesson-rail .meter { display: block; width: 100%; margin: 10px 0 18px; }
.lesson-rail .btn { min-height: 43px; padding: 9px; font-size: .78rem; white-space: normal; }
.lesson-rail a:not(.btn) { display: inline-block; margin-top: 13px; color: var(--med-3); font-weight: 600; font-size: .81rem; line-height: 1.4; }

@media (max-width: 1220px) {
  .lwrap--rail { grid-template-columns: 260px minmax(0,1fr); }
  .lesson-rail { display: none; }
}
@media (max-width: 1040px) {
  .lwrap, .lwrap--rail { grid-template-columns: minmax(0,1fr); }
  .side { top: 68px; inset: 68px 0 0; border-right: 0; background: #f7f6f2; }
  .lbar__menu { display: inline-flex; }
}
@media (max-width: 680px) {
  .main { padding: 28px 17px 64px; }
  .lbar__in { gap: 12px; }
  .article h1 { font-size: clamp(1.9rem,8vw,2.5rem); }
  .side { padding: 16px; }
}
@media print { .lesson-rail { display: none !important; } }

/* Общая палитра учебных страниц. */
body.learn { background: #f3f8fa; }
.lbar { background: #fff; border-bottom: 1px solid #dce9ef; --focus: #a84a25; }
.lbar .brand__mark i:nth-child(1) { background: #83c5c6; }
.lbar .brand__mark i:nth-child(2) { background: #ffbb98; }
.lbar .brand__mark i:nth-child(3) { background: #5c8eaa; }
.lbar__course { color: #41687d; }
.lbar__menu { border-color: #c3d8e1; }
.meter { background: #dcebf0; }
.meter i { background: #4e93ac; }
.side { background: #f3f8fa; border-right-color: #dce9ef; }
.side details[open] > summary,.side li a[aria-current="page"] { background: #e2f0f5; color: #175d75; }
.side summary b { color: #4d8fa9; }
.side li a.is-done::before { background: #4d8fa9; border-color: #4d8fa9; }
.main { background: #fff; }
.eyebrow { color: #6d99b0; }
.article h1,.article h2 { color: #0c3043; }
.tbl thead th { background: #eaf4f7; color: #175d75; }
.call--key { border-left-color: #4d8fa9; }
.pager a:hover { background: #eaf4f7; border-color: #4d8fa9; }
.lesson-rail__card { border-color: #dce9ef; box-shadow: 0 12px 28px -28px #60899d; }
.lesson-rail__card--soft { background: #eaf4f7; }
.train { background: #17536b; }
.train dt { color: #c8e0e9; }
.article pre,.call pre { background: #103447; }
.solution,.hintbox,.calc { background: #f3f8fa; }
.case__opts button { border-color: #b9d0db; }
.case__opts button.is-right { background: #247894; border-color: #247894; }
.own textarea { background: #fbfdfe; border-color: #b9d0db; }
.calc__grid label,.calc__cols label { color: #426478; }
@media (max-width: 1040px) { .side { background: #f3f8fa; } }

/* Короткие визуальные карты решений в уроках. Текст остаётся доступным без изображений и скриптов. */
.expert-map { --map-accent: #276b86; margin: 1.5rem 0 2rem; padding: clamp(16px, 3vw, 25px); border: 1px solid #cbdfe8; border-radius: 17px; background: linear-gradient(145deg, #f1f8fb, #fff); }
.expert-map[data-tone="strategy"] { --map-accent: #264e76; background: linear-gradient(145deg, #eff4fa, #fff); }
.expert-map[data-tone="production"] { --map-accent: #3d765e; background: linear-gradient(145deg, #eef7f0, #fff); }
.expert-map[data-tone="education"] { --map-accent: #58659d; background: linear-gradient(145deg, #f0f2fb, #fff); }
.expert-map figcaption { display: grid; gap: 5px; margin-bottom: 16px; color: #143b4d; }
.expert-map__eyebrow { color: var(--map-accent); font: 700 .71rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.expert-map figcaption strong { font: 600 clamp(1.2rem, 2vw, 1.55rem)/1.25 var(--serif); }
.expert-map ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 0; margin: 0; list-style: none; }
.expert-map ol:has(li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.expert-map li { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 14px; border: 1px solid #dae7eb; border-radius: 11px; background: #fff; line-height: 1.35; }
.expert-map li > span { color: var(--map-accent); font: 700 .76rem/1 var(--sans); }
.expert-map li > strong { color: #173d50; font: 700 .93rem/1.25 var(--sans); }
.expert-map li > small { color: #425d6b; font: 400 .82rem/1.42 var(--sans); }
.expert-map > p { margin: 15px 0 0; color: #35596a; font-size: .87rem; line-height: 1.5; }
@media (max-width: 850px) { .expert-map ol, .expert-map ol:has(li:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 430px) { .expert-map ol, .expert-map ol:has(li:nth-child(3):last-child) { grid-template-columns: 1fr; } }
.lesson-photo { margin: 24px 0 32px; }
.lesson-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: center 45%; border-radius: 16px; }
.lesson-photo figcaption { margin-top: 10px; color: #526675; font-size: .92rem; line-height: 1.5; }
.lesson-photo--lesson { margin-top: 22px; }
@media (max-width: 680px) {
  .lesson-photo img { aspect-ratio: 4 / 3; }
}
