/*
  Курс (/course): витрина, кабинет ученика, маршрут, плеер урока,
  контрольная, повторение.

  Одна таблица стилей на три страницы: /course/ (выбор курса),
  /course/ege/ и /course/oge/. Разметку маршрута и плеера рисует
  /course/app.mjs; программа курса в HTML — статикой, её видит поиск.

  Цвет модуля приходит переменной --m (см. .cr-mod): в него красятся
  узлы маршрута, полоса прогресса и шапка модуля.
*/
:root {
    --cr-navy: #0F1B2A;
    --cr-navy-2: #17294A;
    --cr-ink: #111827;
    --cr-text: #374151;
    --cr-muted: #6B7280;
    --cr-line: #E7E2D9;
    --cr-bg: #F6F3EE;
    --cr-card: #fff;
    --cr-orange: #F5A623;
    --cr-orange-2: #FF8C00;
    --cr-gold: #FFC761;
    --cr-green: #16A34A;
    --cr-green-bg: #ECFDF3;
    --cr-red: #DC2626;
    --cr-red-bg: #FEF2F2;
    --cr-violet: #7C3AED;
    --cr-r: 20px;
    --cr-shadow: 0 18px 40px -26px rgba(15, 27, 42, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cr-body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--cr-text);
    background: var(--cr-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
.cr-body h1, .cr-body h2, .cr-body h3, .cr-body p { margin: 0; }
.cr-body button { font: inherit; cursor: pointer; }
.cr-body a { color: inherit; }
.cr-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.cr-ico { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.cr-ico--fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }

/* ——— кнопки ——— */
.cr-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 48px; padding: 0 22px; border: 0; border-radius: 14px;
    font-weight: 800; font-size: 1rem; text-decoration: none; white-space: nowrap;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, opacity .14s ease;
}
.cr-btn:active { transform: translateY(1px); }
.cr-btn:focus-visible, .cr-node:focus-visible, .cr-tab:focus-visible { outline: 3px solid rgba(245, 166, 35, .55); outline-offset: 3px; }
.cr-btn--go { background: linear-gradient(135deg, var(--cr-orange) 0%, var(--cr-orange-2) 100%); color: #1B1304; box-shadow: 0 14px 26px -14px rgba(255, 140, 0, .9); }
.cr-btn--go:hover { transform: translateY(-1px); box-shadow: 0 18px 30px -14px rgba(255, 140, 0, 1); }
.cr-btn--dark { background: var(--cr-navy); color: #fff; }
.cr-btn--dark:hover { background: var(--cr-navy-2); }
.cr-btn--ghost { background: #fff; color: var(--cr-ink); box-shadow: inset 0 0 0 1.5px var(--cr-line); }
.cr-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #C9C2B5; }
.cr-btn--glass { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.cr-btn--glass:hover { background: rgba(255, 255, 255, .16); }
.cr-btn--sm { min-height: 40px; padding: 0 16px; font-size: .9rem; border-radius: 12px; }
.cr-btn--wide { width: 100%; }
.cr-btn[disabled] { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* ——— шапка курса ——— */
.cr-hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(900px 420px at 88% -10%, rgba(245, 166, 35, .28), transparent 62%),
        radial-gradient(700px 380px at -5% 110%, rgba(99, 102, 241, .3), transparent 60%),
        linear-gradient(160deg, #0B1524 0%, #13233D 55%, #0F1B2A 100%);
}
.cr-hero::before {
    content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.cr-hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 36px; align-items: center; padding: 44px 20px 40px; max-width: 1180px; margin: 0 auto; }
.cr-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(245, 166, 35, .16); color: var(--cr-gold); font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.cr-hero h1 { margin-top: 14px; font-size: clamp(1.7rem, 3.7vw, 2.7rem); line-height: 1.06; font-weight: 900; letter-spacing: -.025em; color: #fff; }
.cr-hero h1 em { font-style: normal; background: linear-gradient(120deg, #FFD27A, #FF9D2E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cr-hero__lead { margin-top: 14px; max-width: 620px; font-size: 1.06rem; color: #C5CEDC; }
.cr-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cr-hero__facts { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 22px; padding: 0; list-style: none; }
.cr-hero__facts li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .84rem; font-weight: 700; color: #E5EAF2; }
.cr-hero__facts .cr-ico { color: var(--cr-gold); }

/* кольцо прогресса в шапке */
.cr-ring { position: relative; width: 196px; height: 196px; flex: none; }
.cr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cr-ring circle { fill: none; stroke-width: 12; }
.cr-ring .bg { stroke: rgba(255, 255, 255, .12); }
.cr-ring .fg { stroke: url(#crRingGrad); stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.cr-ring__txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.cr-ring__txt b { font-size: 2.6rem; font-weight: 900; line-height: 1; color: #fff; letter-spacing: -.03em; }
.cr-ring__txt span { margin-top: 6px; font-size: .78rem; font-weight: 700; color: #AEB9CB; }

.cr-hero__right { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cr-hero__sum { text-align: center; }
.cr-hero__sum b { display: block; font-size: 1.05rem; font-weight: 900; color: #fff; }
.cr-hero__sum span { display: block; margin-top: 2px; font-size: .8rem; color: #AEB9CB; }
.cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.cr-stat { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); }
.cr-stat__k { display: flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9FB0C8; }
.cr-stat__k .cr-ico { color: var(--cr-gold); }
.cr-stat__v { margin-top: 5px; font-size: 1.32rem; font-weight: 900; color: #fff; line-height: 1.15; }
.cr-stat__v small { font-size: .78rem; font-weight: 700; color: #AEB9CB; }

/* ——— вкладки ——— */
.cr-tabs { background: var(--cr-bg); border-bottom: 1px solid var(--cr-line); }
.cr-tabs__in { display: flex; gap: 4px; max-width: 1180px; margin: 0 auto; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.cr-tabs__in::-webkit-scrollbar { display: none; }
.cr-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 15px 14px; border: 0; background: none; color: var(--cr-muted); font-weight: 800; font-size: .95rem; white-space: nowrap; }
.cr-tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.cr-tab.is-on { color: var(--cr-ink); }
.cr-tab.is-on::after { background: var(--cr-orange); }
.cr-tab__n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cr-red); color: #fff; font-size: .7rem; font-weight: 900; }

/* ——— сетка кабинета ——— */
.cr-main { padding: 26px 0 80px; }
.cr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.cr-side { position: sticky; top: 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cr-card { background: var(--cr-card); border-radius: var(--cr-r); padding: 18px; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-card__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cr-card__h b { font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-muted); }
.cr-h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 900; letter-spacing: -.02em; color: var(--cr-ink); line-height: 1.15; }
.cr-sub { margin-top: 6px; color: var(--cr-muted); }

/* «Сегодня» */
.cr-today { background: linear-gradient(150deg, #101D30, #1A2D4F); color: #fff; box-shadow: var(--cr-shadow); }
.cr-today .cr-card__h b { color: var(--cr-gold); }
.cr-today__title { font-size: 1.12rem; font-weight: 900; line-height: 1.25; color: #fff; }
.cr-today__meta { margin-top: 6px; font-size: .86rem; color: #AEB9CB; }
.cr-today .cr-btn { margin-top: 14px; }
.cr-goal { display: flex; align-items: center; gap: 14px; }
.cr-goal__ring { position: relative; width: 62px; height: 62px; flex: none; }
.cr-goal__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cr-goal__ring circle { fill: none; stroke-width: 7; }
.cr-goal__ring .bg { stroke: #EFEAE1; }
.cr-goal__ring .fg { stroke: var(--cr-orange); stroke-linecap: round; transition: stroke-dashoffset .9s ease; }
.cr-goal__ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 900; color: var(--cr-ink); }
.cr-goal b { display: block; font-size: 1.05rem; font-weight: 900; color: var(--cr-ink); }
.cr-goal small { color: var(--cr-muted); font-size: .84rem; }
.cr-row { display: flex; align-items: center; gap: 12px; }
.cr-row + .cr-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid #F0EBE2; }
.cr-row__ico { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 13px; background: #FFF4E0; color: #B45309; flex: none; }
.cr-row__ico--violet { background: #F3EEFF; color: var(--cr-violet); }
.cr-row__ico--green { background: var(--cr-green-bg); color: var(--cr-green); }
.cr-row b { display: block; font-weight: 800; color: var(--cr-ink); line-height: 1.25; }
.cr-row small { display: block; color: var(--cr-muted); font-size: .82rem; }
.cr-row .cr-btn { margin-left: auto; }

/* ——— маршрут ——— */
.cr-mod { --m: #0EA5E9; position: relative; margin-bottom: 26px; border-radius: 26px; background: var(--cr-card); box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); overflow: hidden; }
.cr-mod__head { position: relative; display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--m) 16%, #fff), color-mix(in srgb, var(--m) 5%, #fff)); border-bottom: 1px solid color-mix(in srgb, var(--m) 18%, #fff); }
.cr-mod__num { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: var(--m); color: #fff; font-size: 1.3rem; font-weight: 900; flex: none; box-shadow: 0 10px 18px -10px var(--m); }
.cr-mod__t { min-width: 0; flex: 1; }
.cr-mod__t small { display: block; font-size: .68rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: color-mix(in srgb, var(--m) 70%, #111); }
.cr-mod__t h3 { margin-top: 2px; font-size: 1.22rem; font-weight: 900; color: var(--cr-ink); line-height: 1.2; letter-spacing: -.01em; }
.cr-mod__t p { margin-top: 3px; font-size: .88rem; color: var(--cr-muted); }
.cr-mod__side { text-align: right; flex: none; }
.cr-mod__pct { font-size: 1.15rem; font-weight: 900; color: var(--cr-ink); }
.cr-mod__bar { width: 110px; height: 7px; margin-top: 6px; border-radius: 99px; background: rgba(15, 27, 42, .08); overflow: hidden; }
.cr-mod__bar i { display: block; height: 100%; border-radius: 99px; background: var(--m); transition: width .8s ease; }
.cr-badge { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: .68rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.cr-badge--free { background: var(--cr-green-bg); color: #15803D; }
.cr-badge--paid { background: #FFF4E0; color: #B45309; }
.cr-badge--lock { background: #EEF1F5; color: #64748B; }
.cr-mod.is-locked .cr-mod__head { background: #F6F7F9; border-bottom-color: #ECEFF3; }
.cr-mod.is-locked .cr-mod__num { background: #CBD5E1; box-shadow: none; }
.cr-mod.is-locked .cr-mod__t small { color: #94A3B8; }

.cr-path { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 10px; padding: 26px 18px 28px; }
.cr-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 0; border: 0; background: none; text-align: center; color: var(--cr-ink); }
.cr-node__disc {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 76px; height: 76px; border-radius: 50%;
    background: #fff; color: var(--m); font-weight: 900; font-size: 1.2rem;
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--m) 30%, #fff), 0 7px 0 0 color-mix(in srgb, var(--m) 26%, #fff);
    transition: transform .16s ease, box-shadow .16s ease;
}
.cr-node__disc small { display: block; font-size: .56rem; font-weight: 900; letter-spacing: .06em; opacity: .7; line-height: 1; margin-bottom: 2px; }
.cr-node__disc span { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.cr-node:hover .cr-node__disc { transform: translateY(-2px); }
.cr-node:active .cr-node__disc { transform: translateY(4px); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--m) 30%, #fff), 0 3px 0 0 color-mix(in srgb, var(--m) 26%, #fff); }
.cr-node.is-done .cr-node__disc { background: var(--m); color: #fff; box-shadow: 0 7px 0 0 color-mix(in srgb, var(--m) 62%, #000); }
.cr-node.is-now .cr-node__disc { background: var(--m); color: #fff; box-shadow: 0 7px 0 0 color-mix(in srgb, var(--m) 62%, #000), 0 0 0 7px color-mix(in srgb, var(--m) 22%, transparent); animation: crPulse 2.2s ease-in-out infinite; }
.cr-node.is-locked .cr-node__disc { background: #EEF1F5; color: #94A3B8; box-shadow: 0 7px 0 0 #D8DEE7; }
.cr-node.is-locked { color: #94A3B8; }
.cr-node__t { max-width: 150px; font-size: .82rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.cr-node__stars { display: flex; gap: 2px; height: 16px; }
.cr-node__stars svg { width: 16px; height: 16px; fill: #E5E7EB; }
.cr-node__stars svg.on { fill: #F5A623; }
.cr-node__bubble { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 10px; background: var(--cr-ink); color: #fff; font-size: .66rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; z-index: 1; animation: crBob 1.9s ease-in-out infinite; }
.cr-node__bubble::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--cr-ink); }
.cr-node--test .cr-node__disc { border-radius: 24px; transform: rotate(45deg); width: 66px; height: 66px; margin: 5px 0; }
.cr-node--test .cr-node__disc > * { transform: rotate(-45deg); }
.cr-node--test:hover .cr-node__disc { transform: rotate(45deg) translate(-1px, -1px); }
.cr-node--test .cr-ico { width: 28px; height: 28px; }
.cr-node__pct { font-size: .74rem; font-weight: 900; color: var(--cr-green); }
@keyframes crPulse { 0%, 100% { box-shadow: 0 7px 0 0 color-mix(in srgb, var(--m) 62%, #000), 0 0 0 5px color-mix(in srgb, var(--m) 26%, transparent); } 50% { box-shadow: 0 7px 0 0 color-mix(in srgb, var(--m) 62%, #000), 0 0 0 12px color-mix(in srgb, var(--m) 8%, transparent); } }
@keyframes crBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -4px); } }

/* финал */
.cr-final { --m: #F5A623; }
.cr-final .cr-mod__head { background: linear-gradient(135deg, #101D30, #1F355C); border-bottom: 0; }
.cr-final .cr-mod__t small { color: var(--cr-gold); }
.cr-final .cr-mod__t h3 { color: #fff; }
.cr-final .cr-mod__t p { color: #B9C4D6; }
.cr-final .cr-mod__num { background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-2)); color: #1B1304; }

/* ——— прогресс по номерам ——— */
.cr-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.cr-num { --p: 0; border: 0; padding: 0; font: inherit; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 62px; border-radius: 14px; background: #F3F0EA; color: var(--cr-ink); font-weight: 900; overflow: hidden; }
.cr-num::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p) * 1%); background: linear-gradient(180deg, #86EFAC, #22C55E); opacity: .9; transition: height .8s ease; }
.cr-num.is-low::before { background: linear-gradient(180deg, #FDBA74, #F97316); }
.cr-num.is-mid::before { background: linear-gradient(180deg, #FDE68A, #F5A623); }
.cr-num > * { position: relative; }
.cr-num b { font-size: 1rem; line-height: 1; }
.cr-num small { margin-top: 3px; font-size: .62rem; font-weight: 800; color: rgba(17, 24, 39, .62); }
.cr-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: .8rem; color: var(--cr-muted); }
.cr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cr-forecast { display: flex; align-items: center; gap: 18px; }
.cr-forecast__n { white-space: nowrap; font-size: 3rem; font-weight: 900; line-height: 1; letter-spacing: -.03em; color: var(--cr-ink); }
.cr-forecast__n small { font-size: 1rem; color: var(--cr-muted); font-weight: 800; }
.cr-weak { display: grid; gap: 8px; margin-top: 4px; }
.cr-weak__i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #FAF8F4; }
.cr-weak__i b { flex: none; width: 42px; text-align: center; font-weight: 900; color: var(--cr-ink); }
.cr-weak__i span { flex: 1; min-width: 0; font-size: .9rem; font-weight: 600; color: var(--cr-text); }
.cr-weak__bar { flex: none; width: 74px; height: 7px; border-radius: 99px; background: #E9E4DA; overflow: hidden; }
.cr-weak__bar i { display: block; height: 100%; border-radius: 99px; background: #F97316; }

/* ——— лига ——— */
.cr-league { display: grid; gap: 6px; }
.cr-league__i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.cr-league__i:nth-child(odd) { background: #FAF8F4; }
.cr-league__i.is-me { background: #FFF4E0; box-shadow: inset 0 0 0 1.5px #F5C56B; }
.cr-league__p { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: .84rem; background: #EEE9DF; color: var(--cr-ink); flex: none; }
.cr-league__i:nth-child(1) .cr-league__p { background: linear-gradient(135deg, #FFD86B, #F5A623); }
.cr-league__i:nth-child(2) .cr-league__p { background: linear-gradient(135deg, #E5E7EB, #B8C0CC); }
.cr-league__i:nth-child(3) .cr-league__p { background: linear-gradient(135deg, #F3C7A2, #D08A54); color: #fff; }
.cr-league__i b { flex: 1; min-width: 0; font-weight: 800; color: var(--cr-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-league__i span { font-weight: 900; color: var(--cr-ink); font-size: .9rem; }
.cr-empty { padding: 26px 10px; text-align: center; color: var(--cr-muted); }

/* ——— доступ и оплата ——— */
.cr-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cr-price b { font-size: 2.4rem; font-weight: 900; color: var(--cr-ink); letter-spacing: -.03em; line-height: 1; }
.cr-price s { color: #9CA3AF; font-size: 1.1rem; font-weight: 700; }
.cr-price span { color: var(--cr-muted); font-size: .9rem; }
.cr-feats { display: grid; gap: 9px; margin: 16px 0; padding: 0; list-style: none; }
.cr-feats li { display: flex; gap: 10px; font-size: .95rem; color: var(--cr-text); }
.cr-feats .cr-ico { color: var(--cr-green); margin-top: 3px; }
.cr-code { display: flex; gap: 8px; margin-top: 10px; }
.cr-input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--cr-line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; color: var(--cr-ink); outline: none; transition: border-color .14s ease, box-shadow .14s ease; }
.cr-input:focus { border-color: var(--cr-orange); box-shadow: 0 0 0 4px rgba(245, 166, 35, .18); }
.cr-input--code { text-transform: uppercase; letter-spacing: .08em; }
.cr-msg { margin-top: 10px; font-size: .88rem; font-weight: 700; }
.cr-msg.is-bad { color: var(--cr-red); }
.cr-msg.is-ok { color: var(--cr-green); }
.cr-note { margin-top: 12px; font-size: .82rem; color: var(--cr-muted); }
.cr-label { display: block; margin: 12px 0 6px; font-size: .78rem; font-weight: 800; color: var(--cr-muted); text-transform: uppercase; letter-spacing: .06em; }
.cr-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cr-seg button { padding: 9px 4px; border: 1.5px solid var(--cr-line); border-radius: 12px; background: #fff; font-weight: 800; color: var(--cr-text); line-height: 1.25; }
.cr-seg button small { display: block; font-size: .7rem; font-weight: 600; color: var(--cr-muted); }
.cr-seg button.is-on { border-color: var(--cr-orange); background: #FFF7E8; color: #92400E; }

/* ——— окно (оплата, подсказки) ——— */
.cr-modal { position: fixed; inset: 0; z-index: 10200; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(9, 15, 26, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; animation: crFade .18s ease; }
.cr-modal__box { position: relative; width: 100%; max-width: 520px; margin: auto; padding: 26px; border-radius: 26px; background: #fff; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); animation: crPop .22s cubic-bezier(.2, .9, .3, 1.2); }
.cr-modal__x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #F3F0EA; color: var(--cr-ink); display: flex; align-items: center; justify-content: center; }
.cr-modal__ico { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-2)); color: #1B1304; margin-bottom: 14px; }
.cr-modal__ico .cr-ico { width: 28px; height: 28px; }
.cr-modal h3 { font-size: 1.4rem; font-weight: 900; color: var(--cr-ink); line-height: 1.2; letter-spacing: -.015em; padding-right: 36px; }
.cr-modal p { margin-top: 8px; }
.cr-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; color: #9CA3AF; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.cr-divider::before, .cr-divider::after { content: ""; flex: 1; height: 1px; background: var(--cr-line); }
@keyframes crFade { from { opacity: 0; } }
@keyframes crPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ——— плеер урока / контрольной ——— */
.cr-player { position: fixed; inset: 0; z-index: 10100; display: flex; flex-direction: column; background: var(--cr-bg); animation: crFade .2s ease; }
.cr-player__top { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--cr-line); flex: none; }
.cr-player__x { width: 42px; height: 42px; border: 0; border-radius: 13px; background: #F3F0EA; color: var(--cr-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.cr-player__x:hover { background: #EAE5DB; }
.cr-player__t { min-width: 0; flex: 1; }
.cr-player__t small { display: block; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-muted); }
.cr-player__t b { display: block; font-size: 1.02rem; font-weight: 900; color: var(--cr-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-player__xp { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #FFF4E0; color: #92400E; font-weight: 900; font-size: .9rem; flex: none; }
.cr-steps { display: flex; gap: 6px; flex: none; }
.cr-step { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 12px; background: #F3F0EA; color: var(--cr-muted); font-weight: 800; font-size: .84rem; }
.cr-step.is-on { background: var(--cr-navy); color: #fff; }
.cr-step.is-done { background: var(--cr-green-bg); color: #15803D; }
.cr-player__body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cr-player__in { max-width: 860px; margin: 0 auto; padding: 26px 20px 120px; }
.cr-player__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--cr-line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cr-player__bar .cr-btn { min-width: 170px; }
.cr-player__hint { color: var(--cr-muted); font-size: .88rem; font-weight: 600; }

/* обзор урока */
.cr-over__h { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 900; color: var(--cr-ink); line-height: 1.12; letter-spacing: -.02em; }
.cr-over__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--cr-line); font-size: .82rem; font-weight: 700; color: var(--cr-text); }
.cr-over__steps { display: grid; gap: 12px; margin-top: 22px; }
.cr-over__s { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 18px; border: 0; border-radius: 20px; background: #fff; text-align: left; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); transition: transform .14s ease; }
.cr-over__s:hover { transform: translateY(-1px); }
.cr-over__n { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 15px; background: #FFF4E0; color: #B45309; flex: none; }
.cr-over__n .cr-ico { width: 24px; height: 24px; }
.cr-over__s.is-done .cr-over__n { background: var(--cr-green-bg); color: var(--cr-green); }
.cr-over__s b { display: block; font-size: 1.05rem; font-weight: 900; color: var(--cr-ink); }
.cr-over__s small { display: block; margin-top: 2px; color: var(--cr-muted); font-size: .88rem; }
.cr-over__s > .cr-ico { margin-left: auto; color: #B7B0A3; width: 22px; height: 22px; }
.cr-stars { display: inline-flex; gap: 4px; }
.cr-stars svg { width: 26px; height: 26px; fill: #E5E7EB; }
.cr-stars svg.on { fill: #F5A623; }

/* теория */
.cr-theory { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100%; }
.cr-theory__list { padding: 18px; border-right: 1px solid var(--cr-line); background: #FBF9F6; overflow-y: auto; }
.cr-theory__list h4 { margin: 0 0 12px; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-muted); }
.cr-mat { display: flex; gap: 12px; width: 100%; padding: 12px; margin-bottom: 8px; border: 0; border-radius: 16px; background: #fff; text-align: left; box-shadow: inset 0 0 0 1.5px var(--cr-line); transition: box-shadow .14s ease; }
.cr-mat:hover { box-shadow: inset 0 0 0 1.5px #C9C2B5; }
.cr-mat.is-on { box-shadow: inset 0 0 0 2px var(--cr-orange); background: #FFFBF3; }
.cr-mat__i { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: #F3F0EA; color: var(--cr-ink); font-weight: 900; font-size: .86rem; flex: none; }
.cr-mat.is-read .cr-mat__i { background: var(--cr-green-bg); color: var(--cr-green); }
.cr-mat b { display: block; font-size: .92rem; font-weight: 800; color: var(--cr-ink); line-height: 1.3; }
.cr-mat small { display: block; margin-top: 3px; font-size: .78rem; color: var(--cr-muted); }
.cr-theory__view { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; }
/* Микрошаги: полоска над текстом — пройденные, текущий, впереди; рядом название шага */
.cr-ms { display: grid; gap: 6px; padding: 9px 14px 8px; border-bottom: 1px solid var(--cr-line); flex: none; }
.cr-ms[hidden] { display: none; }
.cr-ms__d { display: flex; gap: 4px; }
.cr-ms__d i { flex: 1 1 0; max-width: 52px; height: 6px; border-radius: 99px; background: var(--cr-line); transition: background .2s; }
.cr-ms__d i.is-ok { background: #F5C27A; }
.cr-ms__d i.is-now { background: #E8850A; }
.cr-ms span { min-width: 0; font-size: .82rem; font-weight: 800; color: var(--cr-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-ms span b { color: #E8850A; margin-right: 6px; }
.cr-theory__bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--cr-line); font-size: .86rem; color: var(--cr-muted); flex: none; }
.cr-theory__bar b { flex: 1; min-width: 0; color: var(--cr-ink); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-theory__bar a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--cr-muted); text-decoration: none; white-space: nowrap; }
.cr-theory__bar a:hover { color: var(--cr-ink); }
.cr-theory__back { display: none; }
.cr-theory iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.cr-player.is-theory .cr-player__body { overflow: hidden; padding-bottom: 76px; }

/* конспект */
.cr-notes { display: grid; gap: 16px; }
.cr-notes__card { padding: 22px; border-radius: 22px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-notes__card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; font-weight: 900; color: var(--cr-ink); margin-bottom: 14px; }
.cr-notes__card h3 .cr-ico { width: 24px; height: 24px; color: var(--cr-orange); }
.cr-notes__card ol, .cr-notes__card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: n; }
.cr-notes__card li { position: relative; padding-left: 40px; color: var(--cr-text); font-size: 1rem; line-height: 1.6; }
.cr-notes__card ol li::before { counter-increment: n; content: counter(n); position: absolute; left: 0; top: 1px; width: 27px; height: 27px; border-radius: 9px; background: #FFF4E0; color: #B45309; font-weight: 900; font-size: .82rem; display: flex; align-items: center; justify-content: center; }
.cr-notes__card--trap { background: #FFFAF5; box-shadow: var(--cr-shadow), inset 0 0 0 1.5px #FED7AA; }
.cr-notes__card--trap h3 .cr-ico { color: #EA580C; }
.cr-notes__card--trap li::before { content: "!"; position: absolute; left: 0; top: 1px; width: 27px; height: 27px; border-radius: 9px; background: #FFEDD5; color: #C2410C; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.cr-notes sub, .cr-notes sup { font-size: .72em; line-height: 0; }

/* задание */
.cr-dots { display: flex; gap: 5px; flex: 1; min-width: 0; }
.cr-dots i { flex: 1; max-width: 46px; height: 8px; border-radius: 99px; background: #E9E4DA; transition: background .2s ease; }
.cr-dots i.is-ok { background: var(--cr-green); }
.cr-dots i.is-bad { background: #F87171; }
.cr-dots i.is-now { background: var(--cr-navy); }
.cr-dots i.is-set { background: #94A3B8; }
.cr-task { padding: 24px; border-radius: 24px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-task__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.cr-task__n { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 10px; background: #EAF2FF; color: #1D4ED8; font-weight: 900; font-size: .82rem; }
.cr-task__m { color: var(--cr-muted); font-size: .84rem; font-weight: 700; }
.cr-task .task-content { font-size: 1.04rem; line-height: 1.7; color: #1B2536; overflow-x: auto; }
.cr-task .task-content p { margin: 0 0 .5em; }
.cr-task .task-content img { max-width: 100%; height: auto; }
.cr-task .task-content table { max-width: 100%; }
.cr-task .task-content .task-sources, .cr-task .task-content table.ans-table, .cr-task .task-content table[style*="border:1px"] { display: none; }
.cr-answer { margin-top: 22px; padding-top: 18px; border-top: 1px solid #F0EBE2; }
.cr-answer__l { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--cr-muted); }
.cr-answer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cr-answer .cr-input { max-width: 320px; height: 54px; font-size: 1.25rem; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.cr-answer .cr-btn { height: 54px; padding: 0 26px; }
.cr-answer__k { display: block; margin-top: 8px; color: var(--cr-muted); font-size: .8rem; font-weight: 600; }
.cr-answer__k kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid #E2DCD0; background: #FAF7F2; font: inherit; font-weight: 800; font-size: .74rem; }
.cr-task__t { padding: 5px 9px; border-radius: 9px; background: #FFF4E0; color: #B45309; font-size: .76rem; font-weight: 800; }
/* Практика: задание и боковая панель со счётом урока */
.cr-player__in.cr-pr { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cr-pr__side { position: sticky; top: 14px; display: grid; gap: 12px; }
.cr-pr__card { padding: 16px 18px; border-radius: 20px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-pr__k { font-size: .74rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; color: var(--cr-muted); margin-bottom: 8px; }
.cr-pr__score { display: flex; align-items: center; gap: 14px; }
.cr-pr__score b { font-size: 2.3rem; font-weight: 900; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.cr-pr__score b small { font-size: 1.1rem; margin-left: 2px; color: var(--cr-muted); }
.cr-pr__score span { font-size: .84rem; font-weight: 700; color: var(--cr-muted); line-height: 1.35; }
.cr-pr__meter { position: relative; margin: 14px 0 6px; }
.cr-pr__meter span { display: block; height: 8px; border-radius: 99px; background: #EFEAE1; overflow: hidden; }
.cr-pr__meter em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F7A928, #E8850A); }
.cr-pr__meter i { position: absolute; top: -3px; width: 2px; height: 14px; border-radius: 2px; background: #C9C0B0; }
.cr-pr__h { display: block; font-size: 1rem; font-weight: 800; color: var(--cr-ink); }
.cr-pr__note { margin: 4px 0 0; color: var(--cr-muted); font-size: .84rem; line-height: 1.45; }
.cr-pr__acts { display: grid; gap: 8px; }
.cr-pr__acts .cr-btn { width: 100%; justify-content: center; }
@media (max-width: 1000px) {
    .cr-player__in.cr-pr { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
    .cr-pr__side { position: static; grid-template-columns: 1fr 1fr; }
    .cr-pr__acts { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .cr-pr__side { grid-template-columns: 1fr; } .cr-pr__acts { grid-template-columns: 1fr; } }
/* Теория урока: бесплатная подробная и переход к авторской */
.cr-free { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: var(--cr-green-bg); color: var(--cr-green); font-size: .7rem; font-weight: 800; letter-spacing: .02em; text-transform: none; vertical-align: middle; }
.cr-author { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 16px; border: 1.5px dashed #E8D9BF; background: #FFFBF3; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.cr-author:hover { border-color: #E8850A; }
.cr-author > span:first-child { flex: 0 0 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #FFF0D6; color: #B45309; }
.cr-author > span:nth-child(2) { flex: 1; min-width: 0; }
.cr-author b { display: block; font-weight: 800; }
.cr-author small { color: var(--cr-muted); font-weight: 600; font-size: .8rem; }
/* Телефон: строка счёта и подсказка формата — только там */
.cr-pr__line, .cr-answer__hint { display: none; }
.cr-answer .cr-input.is-ok { border-color: var(--cr-green); background: var(--cr-green-bg); }
.cr-answer .cr-input.is-bad { border-color: var(--cr-red); background: var(--cr-red-bg); }
.cr-verdict { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; font-weight: 700; animation: crPop .25s ease; }
.cr-verdict .cr-ico { width: 24px; height: 24px; margin-top: 1px; }
.cr-verdict b { display: block; font-size: 1.05rem; font-weight: 900; }
.cr-verdict span { display: block; margin-top: 2px; font-weight: 600; }
.cr-verdict.is-ok { background: var(--cr-green-bg); color: #166534; }
.cr-verdict.is-bad { background: var(--cr-red-bg); color: #991B1B; }
.cr-verdict.is-half { background: #FFF7E8; color: #92400E; }
.cr-verdict__xp { margin-left: auto; align-self: center; padding: 5px 10px; border-radius: 10px; background: #fff; font-weight: 900; white-space: nowrap; }
.cr-sol { margin-top: 14px; border-radius: 16px; background: #FAF8F4; box-shadow: inset 0 0 0 1px #EEE8DD; }
.cr-sol > summary { display: flex; align-items: center; gap: 8px; padding: 13px 16px; font-weight: 800; color: var(--cr-ink); cursor: pointer; list-style: none; }
.cr-sol > summary::-webkit-details-marker { display: none; }
.cr-sol > summary .cr-ico { transition: transform .16s ease; }
.cr-sol[open] > summary .cr-ico { transform: rotate(90deg); }
.cr-sol__body { padding: 0 16px 16px; font-size: .98rem; line-height: 1.7; color: #1F2937; overflow-x: auto; }
.cr-sol__body p { margin: 0 0 .5em; }
.cr-sol__body img { max-width: 100%; height: auto; }
.cr-self { margin-top: 18px; padding: 16px; border-radius: 16px; background: #F5F3FF; box-shadow: inset 0 0 0 1px #DDD6FE; }
.cr-self b { display: block; color: #4C1D95; font-weight: 900; }
.cr-self p { margin-top: 4px; color: #5B21B6; font-size: .92rem; }
.cr-self__pts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cr-self__pts button { min-width: 50px; height: 46px; padding: 0 12px; border: 1.5px solid #C4B5FD; border-radius: 12px; background: #fff; font-weight: 900; color: #4C1D95; }
.cr-self__pts button:hover, .cr-self__pts button.is-on { background: #7C3AED; border-color: #7C3AED; color: #fff; }

/* итог */
.cr-result { text-align: center; padding: 18px 0; }
.cr-result__stars { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.cr-result__stars svg { width: 76px; height: 76px; fill: #E5E7EB; }
.cr-result__stars svg:nth-child(2) { width: 96px; height: 96px; margin-top: -14px; }
.cr-result__stars svg.on { fill: #F5A623; filter: drop-shadow(0 8px 14px rgba(245, 166, 35, .5)); animation: crStar .6s cubic-bezier(.2, .9, .3, 1.5) both; }
.cr-result__stars svg.on:nth-child(2) { animation-delay: .18s; }
.cr-result__stars svg.on:nth-child(3) { animation-delay: .36s; }
@keyframes crStar { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.cr-result h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 900; color: var(--cr-ink); letter-spacing: -.02em; line-height: 1.1; }
.cr-result > p { margin-top: 10px; color: var(--cr-muted); font-size: 1.04rem; }
.cr-result__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 520px; margin: 24px auto 0; }
.cr-result__num { padding: 16px 10px; border-radius: 18px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-result__num b { display: block; font-size: 1.7rem; font-weight: 900; color: var(--cr-ink); line-height: 1; }
.cr-result__num small { display: block; margin-top: 6px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--cr-muted); }
.cr-result__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
/* «Как вам урок?» в итоге урока (course/app.mjs → rateHtml) */
.cr-rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; max-width: 560px; margin: 24px auto 0; padding: 14px 16px; border-radius: 18px; background: #FFF9EF; box-shadow: inset 0 0 0 1px #F2E3C9; animation: crRateIn .4s .6s both ease-out; }
@keyframes crRateIn { from { opacity: 0; transform: translateY(8px); } }
.cr-rate > b { color: var(--cr-ink); font-weight: 800; }
.cr-rate__f { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border: 1.5px solid #E7DCCB; border-radius: 12px; background: #fff; color: var(--cr-ink); font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, border-color .15s; }
.cr-rate__f:hover { border-color: #E8850A; transform: translateY(-1px); }
.cr-rate__f span { font-size: 1.25rem; line-height: 1; }
.cr-rate textarea { flex: 1 1 100%; min-height: 64px; padding: 10px 12px; border: 1.5px solid #E7DCCB; border-radius: 12px; font: inherit; resize: vertical; }
.cr-rate textarea:focus { outline: none; border-color: #E8850A; }
.cr-rate__skip { height: 44px; padding: 0 12px; border: 0; background: none; color: var(--cr-muted); font: inherit; font-weight: 700; cursor: pointer; }
.cr-rate__thanks { color: #15803D; font-weight: 800; }
@media (max-width: 560px) { .cr-rate > b { flex-basis: 100%; text-align: center; } .cr-rate__f { padding: 0 10px; } .cr-rate__f em { display: none; } }
@media (prefers-reduced-motion: reduce) { .cr-rate { animation: none; } }
.cr-bigring { position: relative; width: 170px; height: 170px; margin: 0 auto 18px; }
.cr-bigring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cr-bigring circle { fill: none; stroke-width: 13; }
.cr-bigring .bg { stroke: #E9E4DA; }
.cr-bigring .fg { stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.cr-bigring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 900; color: var(--cr-ink); letter-spacing: -.03em; }
.cr-table { width: 100%; margin-top: 22px; border-collapse: collapse; text-align: left; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-table th, .cr-table td { padding: 11px 14px; border-bottom: 1px solid #F3EFE7; font-size: .92rem; }
.cr-table th { font-size: .7rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; color: var(--cr-muted); background: #FBF9F6; }
.cr-table tr:last-child td { border-bottom: 0; }
.cr-table td b { color: var(--cr-ink); }
.cr-pill { display: inline-flex; padding: 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 900; }
.cr-pill--ok { background: var(--cr-green-bg); color: #15803D; }
.cr-pill--mid { background: #FFF7E8; color: #B45309; }
.cr-pill--bad { background: var(--cr-red-bg); color: #B91C1C; }
.cr-review-list { display: grid; gap: 12px; margin-top: 22px; text-align: left; }

/* контрольная: сетка номеров */
.cr-exam { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.cr-exam__nav { position: sticky; top: 0; padding: 16px; border-radius: 20px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-exam__nav h4 { margin: 0 0 10px; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-muted); }
.cr-exam__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cr-exam__grid button { height: 38px; border: 1.5px solid var(--cr-line); border-radius: 10px; background: #fff; font-weight: 800; font-size: .86rem; color: var(--cr-text); }
.cr-exam__grid button.is-set { background: #EAF2FF; border-color: #BFDBFE; color: #1D4ED8; }
.cr-exam__grid button.is-now { border-color: var(--cr-navy); box-shadow: 0 0 0 2px var(--cr-navy); }
.cr-timer { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 12px; background: #F3F0EA; color: var(--cr-ink); font-weight: 900; font-variant-numeric: tabular-nums; flex: none; }

/* конфетти и всплывающий опыт */
.cr-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10300; overflow: hidden; }
.cr-confetti i { position: absolute; top: -14px; width: 9px; height: 15px; border-radius: 2px; animation: crFall linear forwards; }
@keyframes crFall { to { transform: translate3d(var(--dx), 108vh, 0) rotate(var(--rot)); opacity: .9; } }
.cr-toast { position: fixed; left: 50%; bottom: 28px; z-index: 10400; transform: translateX(-50%); padding: 12px 18px; border-radius: 14px; background: var(--cr-ink); color: #fff; font-weight: 800; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); animation: crPop .2s ease; }
.cr-skel { border-radius: 18px; background: linear-gradient(90deg, #EFEAE1 0%, #F7F4EE 50%, #EFEAE1 100%); background-size: 200% 100%; animation: crShim 1.3s linear infinite; }
@keyframes crShim { to { background-position: -200% 0; } }

/* ——— витрина (гостям и на /course/) ——— */
.cr-sec { padding: 54px 0; }
.cr-sec--alt { background: #fff; }
.cr-sec__h { max-width: 720px; margin-bottom: 28px; }
.cr-eyebrow { display: inline-block; margin-bottom: 10px; font-size: .74rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #B45309; }
.cr-how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cr-how__i { padding: 22px; border-radius: 22px; background: #fff; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .04); }
.cr-sec--alt .cr-how__i { background: var(--cr-bg); box-shadow: none; }
.cr-how__n { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 16px; background: var(--cr-navy); color: var(--cr-gold); margin-bottom: 14px; }
.cr-how__n .cr-ico { width: 24px; height: 24px; }
.cr-how__i h3 { font-size: 1.08rem; font-weight: 900; color: var(--cr-ink); line-height: 1.25; }
.cr-how__i p { margin-top: 8px; font-size: .93rem; color: var(--cr-muted); }
.cr-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cr-pick__c { --m: #F5A623; position: relative; display: flex; flex-direction: column; padding: 26px; border-radius: 28px; background: #fff; color: inherit; text-decoration: none; box-shadow: var(--cr-shadow), inset 0 0 0 1px rgba(15, 27, 42, .05); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.cr-pick__c::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 7px; background: linear-gradient(90deg, var(--m), color-mix(in srgb, var(--m) 55%, #fff)); }
.cr-pick__c:hover { transform: translateY(-3px); box-shadow: 0 30px 50px -30px rgba(15, 27, 42, .55), inset 0 0 0 1px rgba(15, 27, 42, .05); }
.cr-pick__c h3 { margin-top: 8px; font-size: 1.5rem; font-weight: 900; color: var(--cr-ink); letter-spacing: -.02em; line-height: 1.15; }
.cr-pick__c > p { margin-top: 8px; color: var(--cr-muted); }
.cr-pick__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.cr-pick__facts div { padding: 12px 8px; border-radius: 14px; background: var(--cr-bg); text-align: center; }
.cr-pick__facts b { display: block; font-size: 1.3rem; font-weight: 900; color: var(--cr-ink); line-height: 1; }
.cr-pick__facts span { display: block; margin-top: 5px; font-size: .72rem; font-weight: 700; color: var(--cr-muted); }
.cr-pick__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; }
.cr-pick__bar { height: 8px; border-radius: 99px; background: #EFEAE1; overflow: hidden; margin-top: 12px; }
.cr-pick__bar i { display: block; height: 100%; border-radius: 99px; background: var(--m); }
.cr-prog { display: grid; gap: 12px; }
.cr-prog__m { border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px var(--cr-line); overflow: hidden; }
.cr-prog__m > summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.cr-prog__m > summary::-webkit-details-marker { display: none; }
.cr-prog__m > summary b { display: block; font-size: 1.04rem; font-weight: 900; color: var(--cr-ink); }
.cr-prog__m > summary small { display: block; color: var(--cr-muted); font-size: .86rem; }
.cr-prog__m > summary i { --m: #0EA5E9; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 13px; background: var(--m); color: #fff; font-style: normal; font-weight: 900; flex: none; }
.cr-prog__m > summary span { margin-left: auto; flex: none; }
.cr-prog__m ol { margin: 0; padding: 0 18px 16px 72px; display: grid; gap: 7px; color: var(--cr-text); font-size: .95rem; }
.cr-prog__m ol li::marker { color: #B7B0A3; font-weight: 800; }
.cr-faq { display: grid; gap: 10px; max-width: 820px; }
.cr-faq details { border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--cr-line); }
.cr-faq summary { padding: 16px 18px; font-weight: 800; color: var(--cr-ink); cursor: pointer; }
.cr-faq p { padding: 0 18px 16px; color: var(--cr-text); }
.cr-buy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 26px; align-items: start; padding: 30px; border-radius: 30px; background: linear-gradient(150deg, #101D30, #1B2F53); color: #fff; }
.cr-buy h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 900; color: #fff; letter-spacing: -.02em; line-height: 1.12; }
.cr-buy > div > p { margin-top: 10px; color: #C5CEDC; }
.cr-buy .cr-feats li { color: #E5EAF2; }
.cr-buy .cr-feats .cr-ico { color: var(--cr-gold); }
.cr-buy__card { padding: 22px; border-radius: 22px; background: #fff; color: var(--cr-text); }
.cr-buy .cr-buy__card p { margin-top: 12px; color: var(--cr-muted); }
.cr-buy__card a.cr-btn--dark { color: #fff; }

/* ——— телефон ——— */
@media (max-width: 1020px) {
    .cr-grid { grid-template-columns: minmax(0, 1fr); }
    .cr-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); order: -1; }
    .cr-how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cr-buy { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .cr-hero__in { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 30px 16px 28px; }
    .cr-hero h1 { font-size: 1.5rem; }
    .cr-hero__lead { font-size: .96rem; }
    .cr-ring { width: 108px; height: 108px; }
    .cr-ring__txt b { font-size: 1.5rem; }
    .cr-ring__txt span { display: none; }
    .cr-hero__right { flex-direction: row; justify-content: flex-start; gap: 16px; order: -1; }
    .cr-hero__sum { text-align: left; }
    .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cr-wrap { padding: 0 14px; }
    .cr-side { grid-template-columns: minmax(0, 1fr); }
    .cr-path { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 24px 10px 24px; gap: 26px 6px; }
    .cr-mod__head { padding: 16px; gap: 12px; }
    .cr-mod__num { width: 44px; height: 44px; border-radius: 14px; font-size: 1.1rem; }
    .cr-mod__bar { width: 70px; }
    .cr-mod__t h3 { font-size: 1.06rem; }
    .cr-pick, .cr-how { grid-template-columns: minmax(0, 1fr); }
    .cr-sec { padding: 38px 0; }
    .cr-buy { padding: 20px; border-radius: 24px; }
    .cr-prog__m ol { padding-left: 38px; }
    .cr-player__top { padding: 10px 12px; gap: 10px; }
    .cr-steps .cr-step span { display: none; }
    .cr-step { padding: 9px 10px; }
    .cr-player__in { padding: 18px 14px 120px; }
    .cr-player__bar { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    .cr-player__bar .cr-btn { min-width: 0; flex: 1; }
    .cr-player__hint { display: none; }
    .cr-player__bar .cr-ext-bar { display: inline-flex; }
    .cr-player__bar .cr-ext-nav { display: inline-flex; flex: 0 0 auto; min-width: 0; padding-left: 14px; padding-right: 14px; }
    .cr-player__bar .cr-ext-nav--prev { width: 46px; padding: 0; justify-content: center; }
    .cr-player__bar .cr-ext-bar { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
    /* Тренажёр, ФИПИ, тест на телефоне: задания на весь экран, счёт — строкой сверху,
       «Засчитать урок» — в нижней полосе; большая боковая панель не нужна */
    .cr-player__in.cr-pr--ext { display: block; padding: 6px 8px 84px; height: 100%; }
    .cr-pr--ext .cr-pr__side { display: none; }
    .cr-pr--ext .cr-ext { height: 100%; min-height: 0; }
    .cr-pr--ext .cr-ext__bar { padding: 2px 4px 6px; gap: 8px; }
    .cr-pr--ext .cr-ext__bar b { font-size: .82rem; }
    .cr-pr--ext .cr-ext__bar a { font-size: 0; gap: 0; }
    .cr-pr--ext .cr-ext__bar a svg { width: 18px; height: 18px; }
    .cr-pr--ext .cr-ext__count { display: inline-flex; }
    .cr-task { padding: 18px 16px; border-radius: 20px; }
    .cr-answer .cr-input { max-width: none; flex: 1 1 160px; }
    /* position: relative — окно страницы занимает только место теории, а не весь плеер:
       иначе на телефоне оно закрывало верхнюю полосу и кнопку «Следующая часть» */
    .cr-theory { grid-template-columns: minmax(0, 1fr); position: relative; }
    .cr-theory__list { border-right: 0; }
    .cr-theory__view { display: none; position: absolute; inset: 0; z-index: 2; }
    .cr-theory.is-reading .cr-theory__view { display: flex; }
    .cr-theory.is-reading .cr-theory__list { display: none; }
    .cr-theory__back { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 0; border-radius: 10px; background: #F3F0EA; font-weight: 800; color: var(--cr-ink); }
    .cr-exam { grid-template-columns: minmax(0, 1fr); }
    .cr-exam__nav { position: static; order: -1; padding: 12px; }
    .cr-exam__grid { grid-template-columns: repeat(8, 1fr); }
    .cr-result__stars svg { width: 58px; height: 58px; }
    .cr-result__stars svg:nth-child(2) { width: 74px; height: 74px; }
    .cr-modal__box { padding: 22px 18px; border-radius: 22px; }
    .cr-player__xp { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cr-body *, .cr-body *::before, .cr-body *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Вошедший ученик на странице курса: витрина скрыта сразу (класс ставит
   строка в <head>), пока модуль грузит кабинет — заглушка на её месте. */
.cr-authed .cr-course #crLanding { display: none; }
.cr-authed .cr-course:not(:has(#crApp:not([hidden])))::before {
    content: ""; display: block; height: 340px;
    background: linear-gradient(160deg, #0B1524 0%, #13233D 55%, #0F1B2A 100%);
}

/* ——— покупка: заказ, согласие, ключ доступа ——— */
.cr-order { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0 14px; padding: 14px 16px; border-radius: 16px; background: #F7F5F0; }
.cr-order b { display: block; color: var(--cr-ink); font-weight: 800; line-height: 1.25; }
.cr-order small { display: block; margin-top: 3px; color: var(--cr-muted); font-size: .82rem; font-weight: 600; }
.cr-order strong { flex: none; font-size: 1.35rem; font-weight: 900; color: var(--cr-ink); white-space: nowrap; }
.cr-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: .88rem; line-height: 1.45; color: var(--cr-ink); cursor: pointer; }
.cr-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cr-orange-2); }
.cr-check a { color: inherit; text-decoration: underline; }
.cr-paysteps { display: grid; gap: 8px; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--cr-line); list-style: none; counter-reset: crstep; }
.cr-paysteps li { counter-increment: crstep; display: flex; gap: 10px; font-size: .86rem; line-height: 1.45; color: var(--cr-muted); }
.cr-paysteps li::before { content: counter(crstep); flex: none; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #F3F0EA; color: var(--cr-ink); font-size: .74rem; font-weight: 900; }
.cr-transfer { margin: 14px 0 12px; padding: 14px 16px; border-radius: 16px; background: #F7F5F0; box-shadow: inset 0 0 0 1px var(--cr-line); }
.cr-transfer > small { display: block; color: var(--cr-muted); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cr-transfer__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.cr-transfer__row b { font-size: 1.35rem; font-weight: 900; color: var(--cr-ink); letter-spacing: .01em; white-space: nowrap; }
.cr-transfer .cr-paysteps { margin-top: 12px; padding-top: 12px; }
.cr-transfer .cr-paysteps b { color: var(--cr-ink); }
.cr-transfer .cr-paysteps li::before { background: #fff; }
.cr-key { margin-top: 16px; padding: 14px 16px; border: 1.5px dashed #E7C98F; border-radius: 16px; background: #FFFAF0; }
.cr-key small { display: block; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #B45309; }
.cr-key b { display: block; margin: 4px 0; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .06em; color: var(--cr-ink); user-select: all; -webkit-user-select: all; }
.cr-key span { display: block; font-size: .84rem; line-height: 1.45; color: var(--cr-muted); }
.cr-wait { padding: 10px 0 4px; text-align: center; }
.cr-wait h3 { padding-right: 0; }
.cr-spin { display: inline-block; width: 46px; height: 46px; margin-bottom: 14px; border: 4px solid #F1ECE2; border-top-color: var(--cr-orange-2); border-radius: 50%; animation: crSpin .8s linear infinite; }
@keyframes crSpin { to { transform: rotate(360deg); } }
@media (max-width: 420px) { .cr-key b { font-size: 1.15rem; } .cr-order strong { font-size: 1.2rem; } }

/* ————————————————————— авторская теория ————————————————————— */
.th { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%; }
.th-toc { padding: 18px 12px 24px; border-right: 1px solid var(--cr-line); background: #FBF9F6; overflow-y: auto; }
.th-toc__h { padding: 0 8px 14px; }
.th-toc__h b { display: block; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #B45309; }
.th-toc__h small { display: block; margin-top: 4px; font-size: .84rem; font-weight: 600; color: var(--cr-muted); }
.th-toc__bar, .th-top__bar { height: 6px; margin-top: 10px; border-radius: 99px; background: #ECE7DD; overflow: hidden; }
.th-toc__bar i, .th-top__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cr-orange), var(--cr-orange-2)); transition: width .3s ease; }
.th-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.th-toc__g { margin: 12px 8px 4px; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-muted); }
.th-toc__g:first-child { margin-top: 2px; }
.th .th-toc__i { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; text-align: left; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.35; color: var(--cr-text); cursor: pointer; }
.th-toc__i:hover { background: #F1ECE2; }
.th-toc__i > i { flex: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: #ECE7DD; color: var(--cr-muted); font-style: normal; font-size: .74rem; font-weight: 900; }
.th-toc__i > i .cr-ico { width: 13px; height: 13px; }
.th-toc__i > span { padding-top: 2px; }
.th-toc__i.is-done > i { background: var(--cr-green-bg); color: var(--cr-green); }
.th-toc__i.is-on { background: #fff; color: var(--cr-ink); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--cr-orange); }
.th-toc__i.is-on > i { background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-2)); color: #1B1304; }
.th-toc__i.is-locked { color: #9CA3AF; }
.th .th-toc__more, .cr-theory .th-toc__more { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 11px 10px; border: 1.5px dashed var(--cr-line); border-radius: 12px; background: none; font: inherit; font-size: .86rem; font-weight: 700; color: var(--cr-muted); cursor: pointer; }
.th-toc__more:hover { color: var(--cr-ink); border-color: #CFC7B8; }
.th-toc__more .cr-ico { width: 17px; height: 17px; }
.th-main { min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; }
.th-top { display: none; }

.th-body { max-width: 780px; margin: 0 auto; padding: 34px 30px 70px; color: var(--cr-text); font-size: 1.06rem; line-height: 1.72; }
.th-kicker { font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #B45309; }
.th-body h2 { margin: 8px 0 18px; font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 900; line-height: 1.12; letter-spacing: -.02em; color: var(--cr-ink); }
.th-body h3 { margin: 30px 0 10px; font-size: 1.22rem; font-weight: 900; line-height: 1.25; color: var(--cr-ink); }
.th-body p { margin: 0 0 14px; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.th-body section > ul { margin: 0 0 16px; padding-left: 22px; }
.th-body section > ul > li { margin-bottom: 6px; }
.th-body b { color: var(--cr-ink); }
.th-body sub, .th-body sup { font-size: .72em; line-height: 0; }
.th-lead { font-size: 1.17rem; line-height: 1.6; color: var(--cr-ink); }
.th-formula { font-size: 1.22rem; font-weight: 800; color: var(--cr-ink); text-align: center !important; }

.th-fig { margin: 22px 0; padding: 16px; border-radius: 20px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-fig svg { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto; font-family: inherit; }
.th-fig figcaption { margin-top: 12px; font-size: .9rem; line-height: 1.5; color: var(--cr-muted); text-align: center; }
.th-fig img { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto; border-radius: 12px; }
.th-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; margin: 0 auto; }
.th-pair > div { margin: 0; text-align: center; font-size: .86rem; font-weight: 700; line-height: 1.35; color: var(--cr-ink); }
.th-pair img { margin-bottom: 6px; }
.th-credit { display: block; margin-top: 6px; font-size: .74rem; line-height: 1.4; color: #9CA3AF; }
.th-credit a { color: inherit; }

.th-fact, .th-rule, .th-ex { margin: 20px 0; padding: 16px 18px; border-radius: 18px; }
.th-fact > b, .th-rule > b, .th-ex > b { display: block; margin-bottom: 6px; font-size: .76rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.th-fact p:last-child, .th-rule p:last-child, .th-ex p:last-child { margin-bottom: 0; }
.th-fact { background: #F3F0FF; }
.th-fact > b { color: #6D28D9; }
.th-rule { background: #FFF7E8; box-shadow: inset 4px 0 0 var(--cr-orange); }
.th-rule > b { color: #B45309; }
.th-ex { background: #F1F5F9; }
.th-ex > b { color: #334155; }
.th-ex i { color: var(--cr-ink); }

.th-tbl { width: 100%; margin: 16px 0 20px; border-collapse: separate; border-spacing: 0; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--cr-line); font-size: .96rem; line-height: 1.45; }
.th-tbl th { padding: 10px 12px; background: #F6F3EE; font-size: .76rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; text-align: left; color: var(--cr-muted); }
.th-tbl td { padding: 10px 12px; border-top: 1px solid var(--cr-line); vertical-align: top; }
.th-tbl--tight th, .th-tbl--tight td { padding: 8px 9px; text-align: center; white-space: nowrap; }
.th-tbl--tight th:first-child, .th-tbl--tight td:first-child { text-align: left; }
.th-scroll { margin: 16px 0 20px; overflow-x: auto; }
.th-scroll .th-tbl { margin: 0; min-width: 560px; }

.th-e { font-weight: 700; color: var(--cr-ink); white-space: nowrap; word-spacing: -.06em; }
.th-e sup { font-size: .68em; }

.th-nucl { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin: 18px 0; padding: 18px 20px; border-radius: 18px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-nucl__sym { position: relative; padding-left: 44px; font-size: 3.4rem; font-weight: 900; line-height: 1; color: var(--cr-ink); }
.th-nucl__a, .th-nucl__z { position: absolute; left: 0; width: 40px; text-align: right; font-size: 1.3rem; font-weight: 900; line-height: 1; }
.th-nucl__a { top: 0; color: #EA580C; }
.th-nucl__z { bottom: 2px; color: #2563EB; }
.th-nucl ul { flex: 1 1 260px; margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .96rem; line-height: 1.45; }
.th-nucl .is-a { color: #EA580C; }
.th-nucl .is-z { color: #2563EB; }

.th-shells { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 16px 0 20px; }
.th-shells > div { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-shells b { min-width: 30px; font-size: 1.15rem; font-weight: 900; }
.th-shells i { padding: 3px 8px; border-radius: 99px; background: #FFEDD5; color: #C2410C; font-style: normal; font-size: .82rem; font-weight: 800; }
.th-shells span { position: relative; padding: 0 10px 0 3px; font-weight: 800; color: #1D4ED8; }
.th-shells span::after { content: ')'; position: absolute; right: 0; top: -.2em; font-size: 1.3em; font-weight: 400; color: #94A3B8; }

.th-chain { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 18px; }
.th-chain span { position: relative; padding: 4px 11px; border-radius: 10px; font-size: .95rem; font-weight: 800; }
.th-chain span + span::before { content: '→'; position: absolute; left: -17px; top: 50%; transform: translateY(-50%); font-weight: 600; color: #94A3B8; }
.th-chain .is-s, .th-pt__c.is-s, .th-pt-legend .is-s, .th-atom__tile.is-s { background: #DBEAFE; color: #1D4ED8; }
.th-chain .is-p, .th-pt__c.is-p, .th-pt-legend .is-p, .th-atom__tile.is-p { background: #DCFCE7; color: #15803D; }
.th-chain .is-d, .th-pt__c.is-d, .th-pt-legend .is-d, .th-atom__tile.is-d { background: #FFEDD5; color: #C2410C; }

/* квантовые ячейки */
.th-orbs { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 20px; }
.th-orbs > div { padding: 14px 16px; border-radius: 16px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-orbs > div.is-bad { background: var(--cr-red-bg); box-shadow: inset 0 0 0 1px #FECACA; }
.th-orbs > div > small { display: block; margin-top: 8px; font-size: .84rem; line-height: 1.35; color: var(--cr-muted); }
.th-orbs > div.is-bad > small { color: #B91C1C; }
.th-orb { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.th-sub { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.th-sub__cells { display: inline-flex; }
.th-cell { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 34px; margin-left: -1.5px; border: 1.5px solid #94A3B8; background: #fff; font-size: 1rem; line-height: 1; }
.th-cell:first-child { margin-left: 0; border-radius: 7px 0 0 7px; }
.th-cell:last-child { border-radius: 0 7px 7px 0; }
.th-cell:only-child { border-radius: 7px; }
.th-cell i { font-style: normal; font-weight: 900; margin: 0 -.5px; }
.th-cell .u { color: #2563EB; }
.th-cell .d { color: #EA580C; }
.th-sub.is-s .th-cell { border-color: #60A5FA; }
.th-sub.is-p .th-cell { border-color: #4ADE80; }
.th-sub.is-d .th-cell { border-color: #FB923C; }
.th-sub > small { font-size: .74rem; font-weight: 800; color: var(--cr-muted); line-height: 1; }

.th-iso { display: grid; gap: 10px; margin: 16px 0 20px; }
.th-iso > div { padding: 14px 16px; border-radius: 16px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-iso b { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: var(--cr-muted); }
.th-iso p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.th-iso span { padding: 5px 11px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--cr-line); font-weight: 800; color: var(--cr-ink); }
.th-iso span.is-gas { background: #0F1B2A; color: #fff; box-shadow: none; }

.th-steps { margin: 18px 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: thstep; }
.th-steps li { position: relative; padding: 12px 14px 12px 54px; border-radius: 14px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); counter-increment: thstep; }
.th-steps li::before { content: counter(thstep); position: absolute; left: 14px; top: 12px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-2)); color: #1B1304; font-size: .9rem; font-weight: 900; }

/* вопрос после главы */
.th-check { margin: 28px 0 0; padding: 18px; border-radius: 20px; background: var(--cr-navy); }
.th-check__h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-gold); }
.th-check__h .cr-ico { width: 16px; height: 16px; }
.th-check > p { margin-bottom: 12px; font-size: 1.04rem; font-weight: 700; line-height: 1.45; color: #fff; }
.th-check .th-e { color: inherit; }
.th-check__opts { display: grid; gap: 8px; }
.th-check__opts button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 1.5px solid rgba(255, 255, 255, .16); border-radius: 14px; background: rgba(255, 255, 255, .06); font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4; text-align: left; color: #fff; cursor: pointer; transition: background .14s ease, border-color .14s ease; }
.th-check__opts button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .34); }
.th-check__opts button:disabled { cursor: default; opacity: .55; }
.th-check__opts button > i { flex: none; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 9px; background: rgba(255, 255, 255, .14); font-style: normal; font-size: .82rem; font-weight: 900; }
.th-check__opts button.is-ok { background: rgba(34, 197, 94, .2); border-color: #22C55E; opacity: 1; }
.th-check__opts button.is-ok > i { background: #22C55E; color: #052E16; }
.th-check__opts button.is-bad { background: rgba(239, 68, 68, .16); border-color: #EF4444; animation: thShake .32s ease; }
.th-check p.th-check__why { margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(34, 197, 94, .14); font-size: .96rem; font-weight: 500; color: #D1FAE5; }
@keyframes thShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* таблица Менделеева по блокам */
.th-pt { display: grid; grid-template-columns: 16px repeat(18, minmax(0, 1fr)); gap: 3px; }
.th-pt > b { display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; color: var(--cr-muted); }
.th-pt .th-pt__c { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; aspect-ratio: 1 / 1.12; padding: 0 0 3px; border: 1.5px solid rgba(15, 27, 42, .08); border-radius: 7px; font: inherit; font-size: clamp(.58rem, 1.55vw, .88rem); font-weight: 800; line-height: 1.1; }
.th-pt__c > i { position: absolute; top: 2px; left: 3px; font-style: normal; font-size: .6em; font-weight: 700; opacity: .65; }
button.th-pt__c { cursor: pointer; }
button.th-pt__c:hover { border-color: var(--cr-ink); }
.th-pt__c.is-on { z-index: 1; border-color: var(--cr-ink); box-shadow: 0 0 0 2px var(--cr-ink); }
.th-pt-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.th-pt-legend span { padding: 6px 12px; border-radius: 10px; font-size: .84rem; font-weight: 600; }
.th-pt-legend b { color: inherit; margin-right: 4px; }

/* конструктор атома */
.th-atom { margin: 20px 0; padding: 16px; border-radius: 22px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-atom__head { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.th-atom__step { flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1.5px solid var(--cr-line); border-radius: 13px; background: #fff; color: var(--cr-ink); cursor: pointer; }
.th-atom__step:hover:not(:disabled) { border-color: var(--cr-ink); }
.th-atom__step:disabled { opacity: .35; cursor: default; }
.th-atom__tile { position: relative; flex: none; display: flex; align-items: flex-end; justify-content: center; width: 62px; height: 62px; padding-bottom: 7px; border-radius: 16px; }
.th-atom__tile b { font-size: 1.7rem; font-weight: 900; line-height: 1; color: inherit; }
.th-atom__tile i { position: absolute; top: 6px; left: 8px; font-style: normal; font-size: .74rem; font-weight: 800; opacity: .75; }
.th-atom__name { flex: 1; min-width: 0; }
.th-atom__name b { display: block; font-size: 1.2rem; font-weight: 900; line-height: 1.2; }
.th-atom__name small { display: block; font-size: .86rem; font-weight: 600; color: var(--cr-muted); line-height: 1.35; }
.th-atom__grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: center; }
.th-atom__bohr svg { display: block; width: 100%; height: auto; font-family: inherit; }
.th-atom__bohr small { display: block; text-align: center; font-size: .82rem; font-weight: 700; color: var(--cr-muted); }
.th-atom__f small { display: block; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--cr-muted); }
.th-atom__f .th-e { display: block; margin-top: 4px; font-size: 1.2rem; white-space: normal; line-height: 1.5; }
.th-atom__f .th-e.is-short { font-size: 1rem; font-weight: 600; color: var(--cr-muted); }
.th-atom__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.th-atom__stats > div { padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--cr-line); }
.th-atom__stats b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.th-atom__stats span { display: block; font-size: .8rem; font-weight: 600; line-height: 1.3; color: var(--cr-muted); }
.th-atom__note { margin: 10px 0 0 !important; padding: 9px 12px; border-radius: 12px; background: #FFF7E8; font-size: .88rem; font-weight: 600; line-height: 1.4; color: #92400E; }
.th-ladder { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--cr-line); }
.th-ladder__row { display: flex; align-items: flex-start; gap: 12px; }
.th-ladder__row > b { flex: none; width: 46px; padding-top: 8px; font-size: .82rem; font-weight: 800; color: var(--cr-muted); }
.th-ladder__row.is-outer > b { color: #C2410C; }
.th-goals { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--cr-navy); color: #E5EAF2; }
.th-goals__h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--cr-gold); }
.th-goals__h .cr-ico { width: 16px; height: 16px; }
.th-goals__h b { margin-left: auto; color: #fff; }
.th-goals ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.th-goals li { display: flex; align-items: flex-start; gap: 10px; font-size: .94rem; line-height: 1.4; }
.th-goals li > i { flex: none; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(255, 255, 255, .14); font-style: normal; font-size: .78rem; font-weight: 900; color: #fff; }
.th-goals li > i .cr-ico { width: 14px; height: 14px; }
.th-goals li.is-done { color: #BBF7D0; }
.th-goals li.is-done > i { background: #22C55E; color: #052E16; }
.th-goals li b { color: #fff; }

/* граница бесплатной части */
.th-wall { padding: 10px 0 20px; }
.th-wall h2 { margin-top: 0; }
.th-wall ul { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 8px; }
.th-wall li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #FBFAF7; box-shadow: inset 0 0 0 1px var(--cr-line); font-weight: 700; color: var(--cr-ink); }
.th-wall li .cr-ico { flex: none; width: 16px; height: 16px; color: #9CA3AF; }
.th-wall__acts { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 760px) {
    .th { grid-template-columns: minmax(0, 1fr); }
    .th-toc { display: none; position: absolute; inset: 0; z-index: 3; border-right: 0; }
    .th.is-toc .th-toc { display: block; }
    .th-top { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; padding: 9px 14px 10px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--cr-line); font-size: .82rem; font-weight: 700; color: var(--cr-muted); }
    .th-top button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 10px; background: #F3F0EA; font: inherit; font-weight: 800; color: var(--cr-ink); }
    .th-top button .cr-ico { width: 15px; height: 15px; }
    .th-top__bar { flex: 1 1 100%; margin-top: 8px; height: 4px; }
    .th-body { padding: 20px 16px 60px; font-size: 1rem; line-height: 1.68; }
    .th-lead { font-size: 1.08rem; }
    .th-fig { margin: 18px -4px; padding: 12px 10px; border-radius: 16px; }
    .th-fig figcaption { font-size: .84rem; }
    .th-fact, .th-rule, .th-ex { padding: 14px; border-radius: 16px; }
    .th-tbl { font-size: .9rem; }
    .th-tbl th, .th-tbl td { padding: 8px 9px; }
    .th-cell { width: 26px; height: 30px; font-size: .9rem; }
    .th-nucl__sym { font-size: 2.8rem; }
    .th-atom { margin: 18px -4px; padding: 12px 10px; }
    .th-atom__grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .th-atom__bohr svg { max-width: 190px; margin: 0 auto; }
    .th-atom__step { width: 38px; height: 38px; }
    .th-atom__tile { width: 54px; height: 54px; }
    .th-atom__tile b { font-size: 1.45rem; }
    .th-pt { gap: 2px; grid-template-columns: 12px repeat(18, minmax(0, 1fr)); }
    .th-pt .th-pt__c { border-radius: 5px; border-width: 1px; padding-bottom: 2px; }
    .th-pt__c > i { display: none; }
    .th-ladder__row > b { width: 40px; }
    .th-check { padding: 16px 14px; }
    .cr-player__bar .cr-btn.th-prev { min-width: 0; }
    .cr-player__bar .cr-btn.th-prev span { display: none; }
}

/* ——— Уравнения и структурные формулы из учебника органики ———
   Разметку рисует tools/organic/chem.mjs, стили — копия
   organic/assets/org.css, переменные учебника заданы здесь. */
.th-body { --sans: inherit; --paper: #FBFAF7; --line: var(--cr-line); --line-2: #EEE9E1; --muted: var(--cr-muted); --ink: var(--cr-ink); --ink-2: var(--cr-text); --brand-d: #B45309; }
.th-body .f { font-family: var(--sans); font-size: .94em; font-weight: 550; white-space: nowrap; letter-spacing: -.005em; }
.th-body .f sub, .th-body .rx sub { font-size: .72em; line-height: 0; vertical-align: -.28em; }
.th-body .f sup, .th-body .rx sup { font-size: .72em; line-height: 0; vertical-align: .55em; }
.th-body .f .b, .th-body .rx .b { padding: 0 .06em; }

/* ——— Уравнения реакций ——— */
.th-body .rx {
    margin: 1.4em 0 1.5em; padding: 18px 20px 16px; border-radius: 14px;
    background: var(--paper); border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 24px -22px rgba(22, 28, 40, .5);
    overflow-x: auto; scrollbar-width: thin;
    font-family: var(--sans);
}
.th-body .rx__eq {
    /* Уравнение не шире блока: длинное (окисление перманганатом) переносится
       между веществами, а не уезжает за край, где его никто не заметит. */
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 2px;
    min-width: 0; margin: 0 auto; padding: 4px 0;
    font-size: 1.12rem; font-weight: 560; line-height: 1.2; color: var(--ink); letter-spacing: -.005em;
}
.th-body .rx__eq + .rx__eq { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; }
.th-body .rx__sp { display: inline-flex; flex-direction: column; align-items: center; white-space: nowrap; }
.th-body .rx__sp--lab { padding-top: 0; }
.th-body .rx__row { display: inline-flex; align-items: baseline; white-space: nowrap; }
.th-body .rx__lab { margin-top: 5px; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.th-body .rx__k { margin-right: .08em; color: var(--brand-d); font-weight: 750; }
.th-body .rx__plus { margin: 0 .55em; color: var(--muted); font-weight: 400; align-self: center; }
.th-body .rx__txt { font-size: .88rem; color: var(--muted); font-weight: 600; }
.th-body .rx__arr {
    display: inline-grid; grid-template-rows: auto 12px auto; align-items: center; justify-items: center;
    min-width: 64px; margin: 0 .7em; align-self: center;
}
.th-body .rx__c { min-height: 1em; padding: 0 4px; font-size: .74rem; font-weight: 650; line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.th-body .rx__c--b { color: var(--muted); }
.th-body .rx__line { position: relative; width: 100%; height: 2px; background: var(--ink); border-radius: 2px; }
.th-body .rx__line::after {
    content: ""; position: absolute; right: -1px; top: 50%; width: 9px; height: 9px;
    border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); transform: translateY(-50%) rotate(45deg); border-radius: 1px;
}
/* Обратимая реакция: две полустрелки, верхняя вправо, нижняя влево. */
.th-body .rx__line--eq { height: 8px; background: none; }
.th-body .rx__line--eq::after { content: none; }
.th-body .rx__line--eq i { position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); border-radius: 2px; }
.th-body .rx__line--eq i:first-child { top: 0; }
.th-body .rx__line--eq i:last-child { bottom: 0; }
.th-body .rx__line--eq i:first-child::after, .th-body .rx__line--eq i:last-child::before {
    content: ""; position: absolute; width: 9px; height: 2px; background: var(--ink); border-radius: 2px;
}
.th-body .rx__line--eq i:first-child::after { right: 0; top: 0; transform: rotate(35deg); transform-origin: right center; }
.th-body .rx__line--eq i:last-child::before { left: 0; top: 0; transform: rotate(35deg); transform-origin: left center; }
.th-body .rx__row--st { align-items: center; }

/* ——— Структурные формулы (tools/organic/struct.mjs) ———
   Цепь — сетка: верхняя строка — заместители над атомами, средняя — цепь,
   нижняя — заместители под ней. Размеры в em: рисунок растёт вместе
   с кеглем формулы — в уравнении, в таблице и в тексте. */
.th-body .st {
    display: inline-grid; grid-auto-flow: column; align-items: center; justify-items: center;
    vertical-align: middle; line-height: 1.25; white-space: nowrap;
}
.th-body .st__t, .th-body .st__b { display: block; }
.th-body .st__b { padding: 0 .06em; }
.th-body .st__b--wide { padding: 0 .32em; }
/* Клетки заместителей нулевой ширины: подпись свисает симметрично над
   атомом и не раздвигает цепь («CH3–CH–COONa», а не «CH3– CH –COONa»). */
.th-body .st__u, .th-body .st__d { display: flex; flex-direction: column; align-items: center; width: 0; }
.th-body .st__u { align-self: end; }
.th-body .st__d { align-self: start; }
.th-body .st__bt { display: block; line-height: 1.15; }
.th-body .st__v { display: block; width: .07em; min-width: 1.2px; height: .5em; background: currentColor; }
.th-body .st__v--2 { width: .3em; background: none; border-left: max(.07em, 1.2px) solid; border-right: max(.07em, 1.2px) solid; box-sizing: border-box; }
.th-body .st__ring { position: relative; display: block; height: 1.25em; }
.th-body .st__rb { display: block; }
.th-body .st__rb svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.th-body .st__rl { position: absolute; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap; }
/* Реагирующая группа — в пунктирной рамке, как в учебниках. */
.th-body .st__hl {
    align-self: stretch; display: flex; align-items: center;
    background: rgba(234, 88, 12, .07); border-top: 1.5px dashed #EA580C; border-bottom: 1.5px dashed #EA580C;
}
.th-body .st__hl--s { border-left: 1.5px dashed #EA580C; border-radius: 6px 0 0 6px; padding-left: .1em; }
.th-body .st__hl--e { border-right: 1.5px dashed #EA580C; border-radius: 0 6px 6px 0; padding-right: .1em; }
.th-body .st__hl--s.st__hl--e { border-radius: 6px; }
/* Столбик (глицерин, жиры): первые атомы строк — друг под другом. */
.th-body .st-stack {
    display: inline-grid; justify-items: start; align-items: center;
    vertical-align: middle; line-height: 1.25; white-space: nowrap;
}

.th-body .st-stack__v { justify-self: start; margin-left: .3em; display: block; width: .07em; min-width: 1.2px; height: .45em; background: currentColor; }
.th-body .th-tbl .st, .th-body .th-tbl .st-stack { margin: .15em 0; }

.th-body .rx__note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: .86rem; line-height: 1.5; color: var(--muted); text-align: center; font-weight: 500; }
@media (max-width: 560px) {
    .th-body .rx { padding: 14px 12px; }
    .th-body .rx__eq { font-size: 1rem; }
    .th-body .rx__arr { min-width: 54px; margin: 0 .45em; }
}

/* Раздача бесплатных мест: плашка на витрине курса для гостя */
.cr-gift { display: flex; align-items: center; gap: 14px; max-width: 1120px; margin: 16px auto 0; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #FFF4E0, #FFE7C2); box-shadow: inset 0 0 0 1px #F5C77A; }
.cr-gift__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, var(--cr-orange), var(--cr-orange-2)); color: #1B1304; }
.cr-gift__ico .cr-ico { width: 24px; height: 24px; }
.cr-gift__txt { flex: 1; min-width: 0; }
.cr-gift__txt b { display: block; font-size: 1.02rem; font-weight: 900; color: #13233D; }
.cr-gift__txt span { display: block; margin-top: 2px; font-size: .88rem; color: #6B4E1E; }
.cr-gift .cr-btn { flex: none; }
@media (max-width: 640px) {
    .cr-gift { flex-wrap: wrap; margin: 12px 12px 0; }
    .cr-gift .cr-btn { width: 100%; justify-content: center; }
}

/* Теория урока одной частью — без списка материалов, страница во всю ширину */
.cr-theory.is-single .cr-theory__list { display: none; }
/* Заголовок темы в содержании урока, когда частей много (весь раздел учебника) */
.cr-mat__g { margin: 14px 4px 6px; font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; color: #B45309; }
.cr-theory__list h4 + .cr-mat__g { margin-top: 2px; }
.cr-theory.is-single { grid-template-columns: 1fr !important; }
.cr-theory.is-single .cr-theory__back { display: none; }
/* Замок стиля теории (styleWall) — по центру экрана урока */
.cr-player__in > .th-wall { max-width: 560px; margin: 48px auto 0; text-align: center; }
.cr-player__in > .th-wall .cr-modal__ico { margin-left: auto; margin-right: auto; }
.cr-player__in > .th-wall .th-wall__acts { justify-content: center; }

/* Практика вне курса (тренажёр, задания ФИПИ, тест) — страница сайта внутри урока */
.cr-player__in.cr-pr--ext { max-width: 1400px; height: 100%; padding-bottom: 96px; }
.cr-ext { display: flex; flex-direction: column; min-height: calc(100vh - 190px); }
.cr-ext__bar { display: flex; align-items: center; gap: 12px; padding: 4px 6px 10px; }
.cr-ext__bar b { flex: 1; min-width: 0; font-size: .92rem; }
.cr-ext__bar a { display: inline-flex; align-items: center; gap: 6px; color: var(--cr-muted); font-weight: 700; font-size: .85rem; text-decoration: none; }
.cr-ext iframe { flex: 1; width: 100%; border: 0; min-height: 0; }
/* «Засчитать урок» в нижней полосе — только на телефоне, на компьютере он в боковой панели */
.cr-ext-bar, .cr-ext-nav { display: none; }
/* Хими в начале теории, конспекта и практики (course/app.mjs → himi) */
.cr-himi { position: absolute; left: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 40; animation: crHimiIn .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.cr-himi.is-out { animation: crHimiOut .25s ease-in both; }
.cr-himi .hpm-say { max-width: min(320px, calc(100vw - 128px)); box-shadow: 0 18px 40px -18px rgba(27, 42, 74, .55); }
.cr-himi__x { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #6B778A; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .3); cursor: pointer; }
.cr-himi__x .cr-ico { width: 16px; height: 16px; }
@keyframes crHimiIn { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes crHimiOut { to { opacity: 0; transform: translateY(16px) scale(.95); } }
@media (max-width: 720px) { .cr-himi { left: 10px; right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); } }
/* Хими в итоге урока (/js/mascot.js) */
.cr-result__m { display: flex; justify-content: center; margin: -4px 0 4px; }
/* Счёт ответов в строке над заданиями — только на телефоне */
.cr-ext__count { display: none; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--cr-line); font-size: .78rem; font-weight: 800; color: var(--cr-ink); white-space: nowrap; }
.cr-ext__count i { width: 34px; height: 5px; border-radius: 99px; background: #EFEAE1; overflow: hidden; font-style: normal; }
.cr-ext__count i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F7A928, #E8850A); font-size: 0; }
.cr-pr__acts .cr-btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 1000px) { .cr-ext { min-height: 70vh; } }

/*
  Фоны плеера — свой у каждого стиля теории и вида заданий (data-bg у .cr-player,
  ставит course/app.mjs и /learn/). Фон стоит на месте, прокручивается только
  содержимое; движение медленное и ровное — задаёт темп, а не отвлекает.
  При «уменьшить движение» фоны те же, но неподвижные.

    adaptive — «лаборатория»: соты бензольных колец, сияние плывёт (40 с), свет «дышит» раз в 8 с;
    drill    — «лестница»: мятный лист, ступеньки-шевроны медленно поднимаются вверх;
    fipi     — «бланк экзамена»: холодная бумага с клетками для ответов, без движения — как на экзамене;
    tests    — «фокус»: лавандовые круги от центра, ровный пульс раз в 10 с;
    author   — «урок у доски»: тёплая бумага, орбиты атома по углам медленно вращаются, текст — на белом листе;
    short    — «тетрадь в клетку»: клетка у самого конспекта (course/embed-skin.css);
    «Подробно» — без фона: длинный текст учебника читается лучше всего на чистом листе.

  Страница тренажёра, банка или теста внутри урока прозрачная и лежит на этом фоне.
*/
.cr-player[data-bg]::before,
.cr-player[data-bg]::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.cr-player[data-bg] > .cr-player__top,
.cr-player[data-bg] > .cr-player__body { position: relative; z-index: 1; }
.cr-player[data-bg] > .cr-player__bar { z-index: 2; }
.cr-player[data-bg] .cr-player__body { background: transparent; }
/* /learn/: окно страницы — прозрачное, чтобы фон был виден за тестом */
.cr-player[data-bg="tests"] .th-main, .cr-player[data-bg="tests"] .ln-frame { background: transparent; }

/* adaptive — лаборатория */
.cr-player[data-bg="adaptive"] { background: #F6F4EE; }
.cr-player[data-bg="adaptive"]::before {
    background:
        radial-gradient(38% 46% at 18% 22%, rgba(255, 183, 94, .30), transparent 70%),
        radial-gradient(34% 42% at 84% 30%, rgba(110, 168, 255, .24), transparent 70%),
        radial-gradient(40% 40% at 55% 92%, rgba(52, 211, 153, .18), transparent 70%);
    background-size: 160% 160%;
    animation: crAurora 40s ease-in-out infinite alternate, crBreath 8s ease-in-out infinite;
}
.cr-player[data-bg="adaptive"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='27.71' viewBox='0 0 48 27.71'%3E%3Cpath d='M0 13.86 8 0h16l8 13.86-8 13.85H8zM32 13.86h16' fill='none' stroke='%2313233D' stroke-opacity='.06' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 48px 27.71px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 35%, transparent 100%);
    mask-image: radial-gradient(120% 90% at 50% 40%, #000 35%, transparent 100%);
}

/* drill — лестница: ступеньки поднимаются, как сложность задач */
.cr-player[data-bg="drill"] { background: #F2F8F4; }
.cr-player[data-bg="drill"]::before {
    background:
        radial-gradient(50% 60% at 8% 100%, rgba(52, 211, 153, .26), transparent 70%),
        radial-gradient(40% 50% at 96% 8%, rgba(190, 242, 100, .22), transparent 70%);
}
.cr-player[data-bg="drill"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M10 40l10-10 10 10M42 18l10-10 10 10' fill='none' stroke='%23157A4C' stroke-opacity='.10' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 64px 64px;
    animation: crRise 26s linear infinite;
    -webkit-mask-image: linear-gradient(to top, #000, rgba(0, 0, 0, .25));
    mask-image: linear-gradient(to top, #000, rgba(0, 0, 0, .25));
}

/* fipi — бланк экзамена */
.cr-player[data-bg="fipi"] { background: #F3F5F9; }
.cr-player[data-bg="fipi"]::before {
    background:
        linear-gradient(180deg, rgba(62, 134, 200, .10), transparent 30%),
        radial-gradient(45% 55% at 100% 100%, rgba(62, 134, 200, .12), transparent 70%);
}
.cr-player[data-bg="fipi"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cg fill='none' stroke='%232A6197' stroke-opacity='.10'%3E%3Crect x='6.5' y='12.5' width='14' height='16' rx='2'/%3E%3Crect x='24.5' y='12.5' width='14' height='16' rx='2'/%3E%3Crect x='42.5' y='12.5' width='14' height='16' rx='2'/%3E%3C/g%3E%3Cpath d='M66 28.5h48' stroke='%232A6197' stroke-opacity='.07'/%3E%3C/svg%3E");
    background-size: 120px 40px;
    -webkit-mask-image: radial-gradient(130% 100% at 50% 30%, #000 30%, transparent 100%);
    mask-image: radial-gradient(130% 100% at 50% 30%, #000 30%, transparent 100%);
}

/* tests — фокус */
.cr-player[data-bg="tests"] { background: #F5F3FB; }
.cr-player[data-bg="tests"]::before {
    background:
        radial-gradient(42% 48% at 50% 45%, rgba(139, 92, 246, .16), transparent 72%),
        radial-gradient(30% 40% at 0% 0%, rgba(99, 102, 241, .12), transparent 70%);
    animation: crBreath 10s ease-in-out infinite;
}
.cr-player[data-bg="tests"]::after {
    background: repeating-radial-gradient(circle at 50% 45%, transparent 0 46px, rgba(76, 29, 149, .055) 46px 47px);
    -webkit-mask-image: radial-gradient(60% 65% at 50% 45%, #000 20%, transparent 100%);
    mask-image: radial-gradient(60% 65% at 50% 45%, #000 20%, transparent 100%);
    animation: crFocus 10s ease-in-out infinite;
}

/* author — урок у доски: орбиты атома по углам, текст на белом листе */
.cr-player[data-bg="author"] { background: #FAF6EF; }
.cr-player[data-bg="author"]::before {
    background:
        radial-gradient(40% 50% at 100% 0%, rgba(255, 183, 94, .22), transparent 70%),
        radial-gradient(40% 50% at 0% 100%, rgba(236, 72, 153, .08), transparent 70%);
}
.cr-player[data-bg="author"]::after {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%23B45309' stroke-opacity='.10' stroke-width='1.5'%3E%3Cellipse cx='260' cy='260' rx='240' ry='92'/%3E%3Cellipse cx='260' cy='260' rx='240' ry='92' transform='rotate(60 260 260)'/%3E%3Cellipse cx='260' cy='260' rx='240' ry='92' transform='rotate(120 260 260)'/%3E%3C/g%3E%3Ccircle cx='260' cy='260' r='10' fill='%23F5A623' fill-opacity='.18'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%232A6197' stroke-opacity='.08' stroke-width='1.5'%3E%3Cellipse cx='260' cy='260' rx='240' ry='92'/%3E%3Cellipse cx='260' cy='260' rx='240' ry='92' transform='rotate(60 260 260)'/%3E%3Cellipse cx='260' cy='260' rx='240' ry='92' transform='rotate(120 260 260)'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 520px 520px, 420px 420px;
    background-position: calc(100% + 170px) -150px, -150px calc(100% + 130px);
    animation: crOrbit 30s ease-in-out infinite alternate;
}
.cr-player[data-bg="author"] .th-main { background: transparent; }
.cr-player[data-bg="author"] .th-toc { background: rgba(251, 249, 246, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cr-player[data-bg="author"] .th-body { margin-top: 26px; margin-bottom: 96px; background: #fff; border-radius: 26px; box-shadow: 0 1px 0 rgba(19, 35, 61, .04), 0 24px 60px -34px rgba(19, 35, 61, .35); }
@media (max-width: 760px) {
    .cr-player[data-bg="author"] .th-body { margin: 12px 10px 90px; border-radius: 20px; }
}

/* short — клетка у самого конспекта: окно урока прозрачное */
.cr-player[data-bg="short"] { background: #FCFDFF; }
.cr-player[data-bg="short"] .cr-theory__view,
.cr-player[data-bg="short"] .cr-theory iframe,
.cr-player[data-bg="short"] .th-main,
.cr-player[data-bg="short"] .ln-frame { background: transparent; }

@keyframes crAurora { 0% { background-position: 0% 0%; } 50% { background-position: 100% 40%; } 100% { background-position: 30% 100%; } }
@keyframes crBreath { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes crRise { from { background-position: 0 0; } to { background-position: 0 -64px; } }
@keyframes crFocus { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.03); } }
@keyframes crOrbit { from { background-position: calc(100% + 170px) -150px, -150px calc(100% + 130px); } to { background-position: calc(100% + 150px) -130px, -130px calc(100% + 110px); } }
@media (prefers-reduced-motion: reduce) { .cr-player[data-bg]::before, .cr-player[data-bg]::after { animation: none !important; } }
.cr-ext iframe { background: transparent; }

/*
  Задания урока на телефоне (адаптивные, повторение, контрольная): текст
  задания во всю ширину, поле ответа прилипает к низу над полосой урока —
  «Проверить» всегда под пальцем. Счёт — строкой в шапке, формат ответа —
  строкой под полем; большие карточки справа на телефоне не нужны.
*/
@media (max-width: 720px) {
    .cr-player__in.cr-pr:not(.cr-pr--ext) { display: block; padding: 10px 10px calc(var(--cr-bar-h, 72px) + 14px); }
    .cr-pr:not(.cr-pr--ext) .cr-task { padding: 16px 16px 0; border-radius: 20px; overflow: visible; }
    .cr-pr:not(.cr-pr--ext) .cr-task__head { flex-wrap: wrap; row-gap: 6px; }
    .cr-pr:not(.cr-pr--ext) .cr-pr__line { display: inline-flex; margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--cr-muted); }
    .cr-pr:not(.cr-pr--ext) .cr-pr__line b { color: #E8850A; margin-right: 2px; }
    .cr-pr:not(.cr-pr--ext) .task-content { font-size: 15.5px; line-height: 1.5; overflow-x: auto; }
    .cr-pr:not(.cr-pr--ext) .task-content table { font-size: 14px; }
    .cr-pr:not(.cr-pr--ext) .cr-answer { position: sticky; bottom: var(--cr-bar-h, 72px); z-index: 3; margin: 16px -16px 0; padding: 12px 16px 12px; background: #fff; border-top: 1px solid #F0EBE2; border-radius: 0 0 20px 20px; box-shadow: 0 -12px 22px -18px rgba(15, 27, 42, .45); }
    .cr-pr:not(.cr-pr--ext) .cr-answer__l, .cr-pr:not(.cr-pr--ext) .cr-answer__k { display: none; }
    .cr-pr:not(.cr-pr--ext) .cr-answer__row { flex-wrap: nowrap; gap: 8px; }
    .cr-pr:not(.cr-pr--ext) .cr-answer .cr-input { flex: 1 1 auto; min-width: 0; max-width: none; height: 50px; font-size: 1.15rem; }
    .cr-pr:not(.cr-pr--ext) .cr-answer .cr-btn { flex: 0 0 auto; height: 50px; padding: 0 18px; }
    .cr-pr:not(.cr-pr--ext) .cr-answer__hint { display: block; margin-top: 6px; font-size: .78rem; font-weight: 700; color: var(--cr-muted); }
    .cr-pr:not(.cr-pr--ext) .cr-verdict, .cr-pr:not(.cr-pr--ext) .cr-sol, .cr-pr:not(.cr-pr--ext) .cr-self { margin-bottom: 16px; }
    .cr-pr:not(.cr-pr--ext) .cr-pr__side { display: block; margin-top: 10px; }
    .cr-pr:not(.cr-pr--ext) .cr-pr__side .cr-pr__card { display: none; }
    .cr-pr:not(.cr-pr--ext) .cr-pr__acts { display: flex; gap: 8px; }
    .cr-pr:not(.cr-pr--ext) .cr-pr__acts .cr-btn { flex: 1 1 0; height: 44px; font-size: .9rem; }
}
