/* Курсы в гамме основной версии: светлая страница, тёмная полоса как первый экран, деревянная доска. Шапка-пилюля общая, в base.css */
:root { --bg: #f5f3ef; --bg2: #ebe7e1; --line: #e2ddd5; --ink: #1b1916; --muted: #6b655d; --accent: #1b1916; --accent-ink: #f7f3ec; --accent-soft: #ebe7e1;
  --sq-l: #eadbc0; --sq-d: #a8794f; --sq-last: rgba(240, 170, 60, .4); --sq-sel: rgba(27, 25, 22, .2); --arrow-g: #8a4b22; --wood: #8a4b22; --ok: #2f6b3f; --tg: #2aabee; --head: 84px; }
main { min-height: 80vh; min-height: calc(var(--vh, 1vh) * 80); }
.page { padding-top: 104px; }

/* Тёмная полоса заголовка: тот же тёплый свет, что на первом экране главной */
.band { color: #f3e9dc; background: radial-gradient(ellipse 70% 130% at 78% 20%, #3a2618 0%, #1d130c 55%, #0f0a07 100%); padding: 128px 0 44px; --muted: rgba(243, 233, 220, .66); --line: rgba(243, 233, 220, .22); }
/* светлая часть наезжает на тёмную шапку скруглённым краем, как на главной */
.band { position: relative; padding-bottom: 84px; }
.band::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px; border-radius: 40px 40px 0 0; background: var(--bg); }
.band h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.band .lead { color: rgba(243, 233, 220, .78); margin-top: 14px; }
.band .btn { background: #f3e6d4; color: #1d140e; }
.band .btn.ghost { background: transparent; color: #f3e6d4; box-shadow: inset 0 0 0 1.5px rgba(243, 230, 212, .4); }
.band .btn.tg { background: var(--tg); color: #fff; }

/* каталог */
.cat-head { display: grid; justify-items: center; text-align: center; gap: 0; }
.cat-head .lead { margin-inline: auto; }
.cat-head .search { width: min(560px, 100%); margin-top: 28px; }
.search { position: relative; display: block; }
.search input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid rgba(243, 233, 220, .22); background: rgba(243, 233, 220, .08); padding: 0 16px 0 46px; font: 16px var(--font); color: #f3e9dc; outline: none; transition: border-color .2s; }
.search input::placeholder { color: rgba(243, 233, 220, .5); }
.search input:focus { border-color: #f3e9dc; }
.search svg { position: absolute; left: 15px; top: 15px; width: 22px; height: 22px; fill: none; stroke: rgba(243, 233, 220, .6); stroke-width: 2; stroke-linecap: round; }
.chips { position: sticky; top: 84px; z-index: 20; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; margin: 0 auto; padding: 4px; border-radius: 999px; background: #e9e5df; box-shadow: 0 10px 26px -14px rgba(52, 30, 12, .35); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.cat-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; margin-top: 28px; align-items: start; }
.cat-body > section { min-width: 0; }

.filters { position: sticky; top: 148px; max-height: calc(100vh - 164px); overflow-y: auto; scrollbar-width: thin; display: grid; gap: 22px; }
.fg-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: 16px; }
.opt input { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #c9c1b5; background: #fff; display: grid; place-items: center; flex: none; transition: background-color .15s, border-color .15s; margin: 0; }
.opt input[type=radio] { border-radius: 50%; }
.opt input:checked { background: var(--accent); border-color: var(--accent); }
.opt input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -1px; }
.opt input[type=radio]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; rotate: 0deg; translate: 0; }
.opt small { margin-left: auto; color: var(--muted); font-size: 14px; }
.f-actions { display: none; }
.f-reset { justify-self: start; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--wood); }

.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 18px; }
.bar .count { color: var(--muted); font-size: 15px; margin-right: auto; }
.sel { position: relative; }
.sel select { appearance: none; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; padding: 0 40px 0 14px; font: 500 16px var(--font); color: var(--ink); cursor: pointer; }
.sel::after { content: ''; position: absolute; right: 16px; top: 17px; width: 7px; height: 7px; border: 2px solid var(--ink); border-top: 0; border-left: 0; rotate: 45deg; pointer-events: none; }
.f-open { display: none; }
.actives { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.actives:empty { display: none; }
.actives button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); font-size: 14px; font-weight: 500; }
.actives button::after { content: '×'; font-size: 18px; line-height: 1; color: var(--wood); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; }
.card { display: flex; flex-direction: column; gap: 10px; color: inherit; }
.card .cover { margin-bottom: 8px; }
.cover { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 50px -30px rgba(52, 30, 12, .45), 0 8px 20px -12px rgba(52, 30, 12, .2); transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s; }
.card:hover .cover { transform: translateY(-6px); box-shadow: 0 40px 64px -30px rgba(52, 30, 12, .5), 0 12px 26px -12px rgba(52, 30, 12, .22); }
.cover .cb { pointer-events: none; }
.cover .cb-sq i { display: none; }
.tag { position: absolute; z-index: 5; top: 10px; left: 10px; height: 28px; padding: 0 10px; border-radius: 8px; background: rgba(255, 255, 255, .95); color: var(--ink); font-size: 13px; font-weight: 600; display: flex; align-items: center; box-shadow: 0 4px 14px -4px rgba(20, 12, 6, .5); } /* светлая плашка с тенью читается и на белых, и на чёрных фигурах */
.card h3 { font-size: 19px; line-height: 1.25; }
.card { position: relative; }
.card-go { color: inherit; }
.card-go::after { content: ''; position: absolute; inset: 0; z-index: 6; } /* вся карточка — ссылка на курс, выше плашки типа */
.card-go:focus-visible { outline: none; }
.card-go:focus-visible::after { outline: 2.5px solid var(--accent); outline-offset: 4px; border-radius: 16px; }
.card a.pl { position: relative; z-index: 7; } /* имя шахматиста — своя ссылка поверх карточки */
.card .sub { color: var(--muted); font-size: 15px; line-height: 1.45; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: auto; padding-top: 4px; font-size: 14px; color: var(--muted); }
.card .m-a { flex: 1 1 100%; }
.card .price { font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.card .price.free { color: var(--ok); }
s.old { color: var(--muted); font-weight: 400; font-size: .8em; margin-right: 6px; }
.empty { padding: 56px 0; text-align: center; color: var(--muted); display: grid; gap: 16px; justify-items: center; }
.empty b { color: var(--ink); font-size: 20px; }

/* страница курса */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--muted); padding-bottom: 10px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 500; }
.it-kind { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.it-kind span { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; }

/* сложность — уровень шахматиста фигурой: цветная скруглённая плашка и белая фигура, от пешки до ферзя */
.lvl { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--lc); }
.lvl svg { width: 22px; height: 22px; filter: invert(1); }
.l1 { --lc: #4f9a68; } .l2 { --lc: #c9952a; } .l3 { --lc: #dd7630; } .l4 { --lc: #d4524b; } .l5 { --lc: #7d3a5c; }
.lvl-b { position: relative; display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; cursor: help; }
.lvl-b.with { color: var(--ink); font-weight: 600; font-size: 14px; }
.lvl-b.with .lvl { width: 24px; height: 24px; border-radius: 7px; }
.lvl-b.with .lvl svg { width: 19px; height: 19px; }
.card .m-a { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.m-side { color: var(--muted); }
.lvl-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lvl-b::before { content: ''; position: absolute; inset: -8px; }
dd .lvl-b { vertical-align: middle; margin-right: 8px; }
dd:has(.lvl-b) { display: inline-flex; align-items: center; }
.lvl-pop { position: fixed; z-index: 90; width: min(320px, calc(100vw - 20px)); padding: 14px 16px 12px; border-radius: 16px; background: #fff; color: var(--ink); font-size: 14px; line-height: 1.4; box-shadow: 0 18px 50px -14px rgba(20, 12, 6, .45), 0 0 0 1px rgba(27, 25, 22, .04); transform: translateY(6px) scale(.94); transform-origin: var(--nose-x, 50%) 100%; opacity: 0; pointer-events: none; transition: transform .34s cubic-bezier(.2, 1.4, .4, 1), opacity .18s; }
.lvl-pop.in { transform: none; opacity: 1; pointer-events: auto; }
.lvl-pop.below { transform: translateY(-6px) scale(.94); transform-origin: var(--nose-x, 50%) 0; }
.lvl-pop.below.in { transform: none; }
.lvl-pop > b { display: block; font-size: 15px; }
.lvl-pop > span { display: block; color: var(--muted); margin-top: 2px; }
.lvl-scale { display: flex; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.lvl-scale > span { flex: 1; display: grid; justify-items: center; gap: 5px; }
.lvl-scale > span.on .lvl { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.lvl-scale > span.on small { color: var(--ink); font-weight: 600; }
.lvl-scale .lvl { width: 26px; height: 26px; border-radius: 7px; }
.lvl-scale .lvl svg { width: 20px; height: 20px; }
.lvl-scale small { font-size: 11px; line-height: 1.2; color: var(--muted); text-align: center; }
.lvl-nose { position: absolute; bottom: -6px; left: var(--nose-x, 50%); width: 14px; height: 7px; margin-left: -7px; background: #fff; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.lvl-pop.below .lvl-nose { bottom: auto; top: -6px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@media (prefers-reduced-motion: reduce) { .lvl-pop { transition: opacity .18s; } }

/* страница курса: переключатель вёрсток и общие части */
.page h1 { letter-spacing: -.03em; }
.bp { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.bp.free, .bp.own { color: var(--ok); }
.note { font-size: 13.5px; color: var(--muted); }
.player .ls-board { border-radius: 14px; overflow: hidden; box-shadow: 0 34px 60px -30px rgba(52, 30, 12, .45), 0 10px 24px -12px rgba(52, 30, 12, .22); }
.player .ls-note { background: #fff; }
/* 2. как у Modern Chess: описание, покупка и характеристики в панели, содержание, глава в проигрывателе */
.m-h { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; max-width: 18em; }
.pv-2 .lead { margin-top: 14px; }
.m-buy { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: clamp(22px, 3vw, 36px); border-radius: 28px; background: #fff; box-shadow: 0 40px 80px -48px rgba(52, 30, 12, .38), 0 12px 30px -18px rgba(52, 30, 12, .16); }
.m-buy > div:first-child { display: grid; gap: 14px; }
.m-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.m-attrs { display: grid; gap: 10px; padding-left: 28px; border-left: 1px solid var(--line); }
.m-attrs div { display: flex; justify-content: space-between; gap: 16px; font-size: 16px; }
.m-attrs dt { color: var(--muted); }
.m-attrs dd { margin: 0; font-weight: 600; text-align: right; }
.toc { margin-top: 56px; max-width: 760px; }
.toc h2, .player h2, .more h2 { font-size: clamp(28px, 3vw, 38px); margin-bottom: 18px; }
.toc ol { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.toc li { border-bottom: 1px solid var(--line); }
.toc button { width: 100%; display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 12px; align-items: center; min-height: 64px; padding: 10px 0; text-align: left; font-size: 17px; }
.toc button:disabled { opacity: 1; cursor: default; color: var(--muted); }
.toc .n { color: var(--muted); font-variant-numeric: tabular-nums; grid-row: span 2; }
.toc small { grid-column: 2; font-size: 14px; color: var(--muted); }
.toc svg { grid-column: 3; grid-row: 1 / span 2; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toc button:not(:disabled) svg { stroke: var(--ok); }
.toc li.on button { font-weight: 600; }
.toc .free { display: inline-flex; margin-left: 8px; height: 22px; padding: 0 8px; border-radius: 6px; background: #e2efe5; color: var(--ok); font-size: 12.5px; font-weight: 600; align-items: center; vertical-align: 2px; }
.player { margin-top: 56px; scroll-margin-top: 100px; }
.player .lessons .ls-tabs { display: none; }
.more { margin-top: 64px; }
.mbar { display: none; }


/* защита: имя покупателя поверх доски, нотации и видео, без выделения и копирования */
.guarded { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wm { position: absolute; inset: 0; z-index: 8; pointer-events: none; background-repeat: repeat; }

/* кабинет */
.me { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ava { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--tg); color: #fff; font-size: 30px; font-weight: 700; flex: none; }
.me h1 { font-size: clamp(32px, 4vw, 48px); }
.me p { color: rgba(243, 233, 220, .66); font-size: 15px; margin-top: 4px; }
.me .btn { margin-left: auto; }
.my-sec { margin-top: 48px; }
.my-sec h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 18px; }
.dev { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); max-width: 760px; }
.dev b { display: block; }
.dev span { color: var(--muted); font-size: 15px; }

/* дебюты на заказ */
.ord-b { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; margin-bottom: 32px; padding: 20px 22px 20px 26px; border-radius: 24px; color: #f3e9dc; background: radial-gradient(ellipse 80% 160% at 85% 0%, #3a2618 0%, #1d130c 60%, #0f0a07 100%); box-shadow: 0 30px 60px -40px rgba(20, 12, 6, .7); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.ord-b:hover { transform: translateY(-3px); }
.ord-b b { display: block; font-size: clamp(19px, 1.8vw, 23px); letter-spacing: -.02em; }
.ord-b span:not(.btn) { display: block; color: rgba(243, 233, 220, .7); margin-top: 4px; font-size: 15px; }
.ord-b .btn { background: #f3e6d4; color: #1d140e; }
.ord-b .btn { flex: none; }
.ord { max-width: 820px; padding-top: 24px; }
.ord-steps { list-style: none; padding: 0; }
.ord-steps li { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.25; font-weight: 600; letter-spacing: -.02em; color: var(--muted); padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--line); }
.ord-steps b { color: var(--ink); font-weight: 700; }
.ord-note { margin-top: 28px; font-size: 18px; color: var(--muted); }
.ord-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.ord-acts .btn svg { width: 22px; height: 22px; fill: currentColor; }

/* админка Александра (демо) */
.adm-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; }
.adm-err { color: #b3401f; font-size: 15px; margin: 12px 0; min-height: 1px; }
.adm-err:empty { margin: 0; }
.adm-list { margin-top: 28px; }
.adm-inv { margin: 56px 0 24px; max-width: 760px; }
.adm-inv h2 { font-size: clamp(24px, 2.6vw, 30px); margin-bottom: 8px; }
.adm-inv > p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.adm-inv-f, .adm-inv-out { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.adm-inv-f .field { flex: 1 1 260px; margin: 0; }
.adm-inv-out input { flex: 1 1 260px; min-width: 0; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 16px; font: 16px var(--font); color: var(--ink); }
#adm-out { margin-top: 10px; }
.adm-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.adm-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 12px 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.adm-c { width: 64px; border-radius: 8px; overflow: hidden; }
.adm-c .cb-sq i { display: none; }
.adm-t b { display: block; font-weight: 600; line-height: 1.3; }
.adm-t span { color: var(--muted); font-size: 14px; }
.adm-st { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #e2efe5; color: var(--ok); white-space: nowrap; }
.adm-st.off { background: var(--accent-soft); color: var(--muted); }
.adm-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ed-title { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; }
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; margin-top: 24px; }
.ed-f { display: grid; gap: 18px; }
.ed-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field select, .field textarea { width: 100%; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: 16px var(--font); color: var(--ink); outline: none; }
.field select { height: 52px; padding: 0 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 23px, calc(100% - 15px) 23px; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { padding: 14px 16px; line-height: 1.5; resize: vertical; }
.field textarea.mono { font: 14px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; }
.field select:focus, .field textarea:focus { border-color: var(--ink); }
.ed-load { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.field input[type=range] { width: 100%; accent-color: var(--ink); height: 44px; }
.ed-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ed-p { position: sticky; top: 96px; display: grid; gap: 12px; }
.ed-p .card { pointer-events: none; }
.ed-empty { color: var(--muted); font-size: 15px; padding: 24px; border-radius: 14px; background: var(--bg2); }
.ed-play { margin-top: 56px; }
.ed-play h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }

/* листы: вход, оформление, демо-оплата */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(15, 10, 7, .5); animation: fadein .25s both; }
.sheet-card { position: relative; width: min(480px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow: auto; background: var(--bg); border-radius: 22px; padding: 26px; display: grid; gap: 16px; animation: pop .35s cubic-bezier(.2, .8, .2, 1) both; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.sheet-x svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.sheet-card h2 { font-size: 28px; padding-right: 40px; margin: 0; }
.sheet-lead { color: var(--muted); }
.btn.tg { background: var(--tg); color: #fff; }
.btn.tg svg { width: 22px; height: 22px; fill: #fff; }
.co-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); }
.co-item .mini { width: 64px; }
.co-item b { font-size: 16px; line-height: 1.25; display: block; }
.co-item span { font-size: 14px; color: var(--muted); }
.co-item .p { font-weight: 700; white-space: nowrap; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 16px; font: 16px var(--font); color: var(--ink); outline: none; }
.field input:focus { border-color: var(--ink); }
.field small { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.field small.err { color: #b3401f; }
.pm { display: grid; gap: 8px; }
.pm label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .2s; }
.pm label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.pm input { appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #c9c1b5; margin: 0; display: grid; place-items: center; }
.pm input:checked { border-color: var(--accent); }
.pm input:checked::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.pm b { font-weight: 600; display: block; }
.pm small { color: var(--muted); font-size: 13.5px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; padding-top: 4px; }
.total b { font-size: 26px; }
.stub { border-radius: 16px; background: #fff; box-shadow: 0 0 0 1.5px var(--line); padding: 22px; display: grid; gap: 10px; text-align: center; justify-items: center; }
.stub .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); }
.stub .ico svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stub .ico.ok { background: #e2efe5; }
.stub .ico.ok svg { stroke: var(--ok); }
.stub b { font-size: 18px; }
.stub p { color: var(--muted); font-size: 15px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.sheet-acts { display: grid; gap: 8px; }
.demo-note { font-size: 13px; color: var(--muted); text-align: center; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes spin { to { rotate: 360deg; } }

.sfoot { margin-top: 96px; padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.sfoot .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.sf-docs { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.sf-docs a { color: inherit; }
.sf-docs a:hover { color: var(--ink); }

@media (max-width: 1080px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  :root { --head: 0px; }
  .page { padding-top: 16px; }
  .band { padding: 28px 0 28px; }
  .cat-head { grid-template-columns: 1fr; }
  .cat-body { grid-template-columns: 1fr; margin-top: 18px; }
  /* фильтры на телефоне — лист снизу */
  .filters { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; max-height: 82svh; overflow: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(20, 12, 6, .25); transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
  .filters.open { transform: none; }
  .f-actions { display: grid; position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0 4px; }
  .f-open { display: inline-flex; }
  .f-dim { position: fixed; inset: 0; z-index: 65; background: rgba(20, 12, 6, .4); }
  .grid { grid-template-columns: 1fr; }
  .chips { top: calc(8px + env(safe-area-inset-top)); }
  .bar { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 19; background: var(--bg); padding: 8px 0; margin-bottom: 10px; }
  .bar .count { display: none; }
  .bar .sel { flex: 1; } .bar .sel select { width: 100%; }
  .toc { margin-top: 36px; }
  .band { padding-bottom: 64px; }
  .band::after { height: 28px; border-radius: 28px 28px 0 0; }
  .m-buy { grid-template-columns: 1fr; border-radius: 24px; }
  .m-attrs { padding-left: 0; padding-top: 18px; border-left: 0; border-top: 1px solid var(--line); }
  .player { margin-top: 40px; scroll-margin-top: 16px; }
  .mbar { display: flex; position: fixed; z-index: 25; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); gap: 12px; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(20, 12, 6, .18), 0 0 0 1px var(--line); }
  .mbar b { font-size: 20px; }
  body:has(.mbar) { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .me .btn { margin-left: 0; }
  .ord-b { flex-direction: column; align-items: stretch; border-radius: 20px; padding: 20px; }
  .ord-acts .btn { flex: 1 1 100%; }
  .adm-row { grid-template-columns: 56px minmax(0, 1fr); }
  .adm-inv-f .btn, .adm-inv-out .btn { flex: 1 1 100%; }
  .adm-c { width: 56px; }
  .adm-st { grid-column: 2; justify-self: start; }
  .adm-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .ed { grid-template-columns: 1fr; }
  .ed-p { position: static; max-width: 420px; }
  .dev { flex-direction: column; align-items: flex-start; }
  .sheet { place-items: end center; }
  .sheet-card { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; max-height: 92svh; padding-bottom: calc(26px + env(safe-area-inset-bottom)); animation-name: up; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}
@media (min-width: 640px) and (max-width: 860px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Скелетон, пока курсы приходят с сервера ===== */
.sk { display: block; border-radius: 8px; background: rgba(27, 25, 22, .08); animation: sk-pulse 1.4s ease-in-out infinite; }
.band .sk { background: rgba(243, 233, 220, .1); }
.sk-l { height: 14px; margin-top: 10px; }
.sk-sm { height: 11px; }
.sk-c { margin-inline: auto; }
.sk-h1 { width: min(380px, 70%); height: clamp(40px, 5vw, 60px); margin: 0 auto 16px; border-radius: 12px; }
.sk-search { width: min(560px, 100%); height: 52px; margin-top: 28px; border-radius: 16px; }
.sk-chips { display: flex; gap: 8px; justify-content: center; margin-top: -24px; position: relative; z-index: 1; }
.sk-chips .sk { width: 92px; height: 44px; border-radius: 999px; background: #e6e2da; }
.sk-side { display: grid; gap: 4px; align-content: start; }
.sk-cover { aspect-ratio: 1; border-radius: 14px; margin-bottom: 8px; }
.skel .cat-head > div { width: 100%; }
.sk-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sk-bar .sk-l { margin: 0; }
.sk-sel { width: 200px; height: 44px; border-radius: 12px; }
.sk-tile { height: 92px; border-radius: 18px; margin-bottom: 28px; background: rgba(29, 20, 14, .14); }
.sk-item { padding-top: 120px; max-width: 1180px; }
.sk-tags { display: flex; gap: 8px; margin: 20px 0 16px; }
.sk-tags .sk { width: 84px; height: 26px; border-radius: 8px; }
.sk-title { width: min(560px, 90%); height: clamp(36px, 4.4vw, 52px); border-radius: 12px; margin-bottom: 8px; }
.sk-panel { height: 200px; border-radius: 22px; margin: 34px 0 44px; background: rgba(27, 25, 22, .06); }
.sk-h2 { width: 220px; height: 36px; border-radius: 10px; margin-bottom: 18px; }
.sk-row { height: 62px; border-radius: 12px; margin-bottom: 8px; }
@keyframes sk-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
@media (max-width: 860px) {
  .sk-side { display: none; }
  .sk-chips { justify-content: flex-start; overflow: hidden; margin-top: -22px; }
  .sk-item { padding-top: 28px; }
  .sk-panel { height: 260px; }
  .sk-sel { width: 150px; }
}

/* ===== Вход: Telegram и код на почту ===== */
.lg { max-width: 420px; }
.lg-page { margin: 40px auto 24px; } /* вход по центру, как заголовок над ним */
.lg-btn { width: 100%; justify-content: center; gap: 10px; }
.lg-btn + .lg-btn { margin-top: 10px; }
.lg-btn:disabled { opacity: .6; }
.btn.ya { background: #000; color: #fff; }
.btn.ya svg { width: 22px; height: 22px; }
.lg-or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 14px; }
.lg-or::before, .lg-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.lg-f { display: grid; gap: 14px; }
.lg-f .field { margin: 0; }
.lg-f > .btn { width: 100%; }
.lg-sent { color: var(--muted); font-size: 15px; line-height: 1.5; }
.lg-sent b { color: var(--ink); font-weight: 600; }
#lg-code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
#lg-code::placeholder { letter-spacing: normal; }
.lg-alt { display: flex; gap: 10px; flex-wrap: wrap; }
.lg-alt .btn { flex: 1 1 160px; }
.lg-off { color: var(--muted); }
.lg .adm-err { margin: 12px 0 0; }
@media (max-width: 500px) { .lg-alt .btn { flex-basis: 100%; } }

/* ===== Покупка через Александра и доступы в управлении ===== */
.co-acts { display: grid; gap: 10px; margin-top: 16px; }
.co-acts .btn { width: 100%; justify-content: center; gap: 10px; }
.ac-h { font-size: 18px; margin: 26px 0 10px; }
.ac-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.ac-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ac-list li b { display: block; font-weight: 600; }
.ac-list li span { color: var(--muted); font-size: 14px; }
.ac-list .ac-empty { color: var(--muted); font-size: 15px; display: block; }

/* ===== Ученик / Управление: вкладки как в отзывах на главной, в тёмной шапке ===== */
.role-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(243, 233, 220, .1); margin-bottom: 28px; }
.role-seg a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 500; color: rgba(243, 233, 220, .66); transition: background-color .25s, color .25s; }
.role-seg a:hover { color: #f3e6d4; }
.role-seg a[aria-current] { background: #f3e6d4; color: #1d140e; }
@media (max-width: 860px) { .role-seg { display: flex; margin-bottom: 22px; } .role-seg a { flex: 1; justify-content: center; } }

/* ===== Управление: карточки по три, как в каталоге ===== */
.adm-grid { margin-top: 32px; }
.adm-cv { display: block; color: inherit; }
/* скрытый или удалённый курс: обложка блёклая и серая, по центру белая плашка с причиной */
.adm-card.off .cover > :not(.tag):not(.cv-off) { filter: grayscale(1); opacity: .5; }
.cv-off { position: absolute; z-index: 5; inset: 0; margin: auto; width: max-content; height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 26px -10px rgba(20, 12, 6, .45); }
.cv-off svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adm-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; margin-top: 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.adm-facts dt { font-size: 13px; color: var(--muted); }
.adm-facts dd { font-size: 17px; font-weight: 600; margin-top: 2px; }
.adm-card .adm-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; } /* два на два: «Удалить» не висит одна на всю ширину */

/* ===== Редактор: кнопки загрузки, списки, перетаскивание, скрыть и удалить ===== */
.ed-load label.btn { display: inline-flex; margin: 0; font-size: 15px; font-weight: 600; } /* label внутри .field иначе берёт стиль подписи поля */
.ed-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.field select { padding-right: 40px; text-overflow: ellipsis; }
.ed-drop { position: relative; border-radius: 18px; transition: box-shadow .2s, background-color .2s; }
.ed-drop.on { box-shadow: 0 0 0 2px var(--ink); background: rgba(27, 25, 22, .04); }
.ed-drop.on textarea { border-style: dashed; }
.ed-acts .ed-side { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.btn.ghost.danger { color: #b3401f; }
@media (max-width: 860px) { .ed-acts .ed-side { margin-left: 0; width: 100%; } .ed-acts .btn { flex: 1 1 100%; } }

/* администратор на странице курса */
.it-adm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin-bottom: 20px; border-radius: 16px; background: rgba(27, 25, 22, .05); }
.it-adm .adm-st { margin-right: auto; }
@media (max-width: 860px) { .it-adm .btn { flex: 1 1 auto; } .it-adm .adm-st { flex: 1 1 100%; text-align: center; } }
.ac-me { color: var(--muted); font-size: 14px; }
.adm-inv .ac-list { margin-bottom: 20px; }
.adm-tabs { position: static; margin-top: 28px; }
.adm-tabs .n { color: var(--muted); font-weight: 500; margin-left: 2px; }
.adm-tabs .chip[aria-pressed=true] .n { color: inherit; opacity: .7; }
.adm-grid > .ac-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; }
.btn.danger-fill { background: #b3401f; color: #fff; }
.cf-acts { display: grid; gap: 10px; margin-top: 20px; }
.cf-acts .btn { width: 100%; }
.card .m-ch { color: var(--muted); font-size: 15px; }
.card .m-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 16px; font-weight: 600; }
.card .m-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.card:hover .m-go svg { transform: translateX(3px); }

/* ===== Главы курса: партии из поля PGN, у главы номер, название и число ходов ===== */
.ed-lbl { font-size: 14px; font-weight: 600; }
.field .ed-hint { margin: 2px 0 12px; }
.ed-chs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ed-chs:empty { display: none; }
.ch { padding: 10px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.ch-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-areas: "n name" ". meta"; gap: 2px 10px; align-items: center; }
.ch-n { grid-area: n; font-weight: 700; color: var(--muted); text-align: center; }
.field .ch-name { grid-area: name; height: 42px; padding: 0 10px; border-radius: 10px; border-color: transparent; background: var(--bg2); }
.field .ch-name:hover { border-color: var(--line); }
.field .ch-name:focus { border-color: var(--ink); background: #fff; }
.ch-meta { grid-area: meta; padding-left: 12px; font-size: 13px; color: var(--muted); }

/* ===== Поле PGN с подсветкой: прозрачный текст поверх подсвеченной копии, шрифт и отступы одинаковые ===== */
.pgn-ed { position: relative; }
.pgn-ed .pgn-hl, .pgn-ed .pgn-t { margin: 0; padding: 12px 14px; border: 1.5px solid transparent; border-radius: 14px; font: 14px/1.6 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 4; scrollbar-gutter: stable; }
.pgn-ed .pgn-hl { position: absolute; inset: 0; overflow: hidden; background: #fff; color: var(--ink); pointer-events: none; }
.pgn-ed .pgn-t { position: relative; display: block; width: 100%; min-height: 200px; max-height: 70vh; overflow-y: auto; resize: vertical; background: transparent; color: transparent; caret-color: var(--ink); border-color: var(--line); outline: none; }
.pgn-ed .pgn-t:focus { border-color: var(--ink); }
.pgn-ed .pgn-t::placeholder { color: #a39686; opacity: 1; }
.pgn-ed .pgn-t::selection { background: rgba(196, 140, 60, .3); }
@media (pointer: coarse) { .pgn-ed .pgn-hl, .pgn-ed .pgn-t { font-size: 16px; } }
.pgn-hl .h { color: #8a7f73; }
.pgn-hl .n { color: #a39686; }
.pgn-hl .m { color: var(--ink); }
.pgn-hl .v { color: #3d63a8; }
.pgn-hl .c { color: #2c7a4b; }
.pgn-hl .a { color: #c0701d; }
.pgn-hl .g { color: #c0392b; }
.sheet .pgn-ed { margin-top: 16px; }

/* ===== Скелетоны остальных страниц: кабинет, вход, управление, редактор, заказ ===== */
.sk-grow { flex: 1; min-width: 0; width: 100%; }
.sk-seg { width: 234px; height: 52px; border-radius: 999px; margin-bottom: 28px; }
.sk-ava { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.sk-name { width: min(340px, 70%); height: clamp(32px, 4vw, 48px); border-radius: 12px; }
.sk-out { width: 92px; height: 44px; border-radius: 12px; }
.sk-h1.sk-left { margin: 0 0 16px; }
.sk-cta { width: 190px; height: 58px; border-radius: 14px; }
.sk-btn { height: 58px; border-radius: 14px; margin-bottom: 12px; }
.sk-in { height: 52px; border-radius: 14px; margin: 8px 0 12px; background: rgba(27, 25, 22, .06); }
.sk-f .sk-in { margin-bottom: 0; }
.sk-step { padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--line); }
.sk-big { height: clamp(20px, 2.2vw, 28px); border-radius: 10px; }
.skel .ed-f { gap: 22px; }
.skel .adm-grid .sk-cover, .skel .my-sec .sk-cover { margin-bottom: 12px; }
@media (max-width: 860px) { .sk-cta { width: 100%; } .adm-h .sk-cta { width: 160px; } .sk-seg { width: 100%; } .skel .ed-p { display: none; } }
.card .m-own { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 17px; font-weight: 700; }
.card .m-own svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sk-crumb { margin: 16px 0 26px; }
.sk-chips.sk-adm { margin-top: 28px; }
@media (max-width: 640px) { .ed-load .btn { flex: 1 1 100%; justify-content: center; } } /* на телефоне кнопки добавления глав одной колонкой во всю ширину, а не лесенкой */
.ed-miss { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #fbf0dc; color: #6b4a14; font-size: 14px; line-height: 1.45; }
.lg-legal { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.lg-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
