/* Courses (/kursy/): the course lives in a spreadsheet — formula bar, cell
   references, an active-cell selection, sheet tabs under the player.
   Uses the site tokens from site.css. */
.kurs { --cell: rgba(255,255,255,.055); --sel: var(--teal); }

/* ---------- hero: a sheet in the background */
.k-hero { position: relative; overflow: hidden; padding: 128px 0 56px; }
.sheet-bg { position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image: linear-gradient(var(--cell) 1px, transparent 1px), linear-gradient(90deg, var(--cell) 1px, transparent 1px);
  background-size: 120px 34px; background-position: 44px 30px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(120% 90% at 70% 40%, #000 30%, transparent 75%); }
.sb-cols { position: absolute; left: 44px; top: 0; height: 30px; display: flex; }
.sb-cols i { width: 120px; font: 600 11px/30px var(--mono); color: rgba(255,255,255,.22); text-align: center; font-style: normal; }
.sb-rows { position: absolute; left: 0; top: 30px; width: 44px; display: grid; }
.sb-rows i { height: 34px; font: 600 11px/34px var(--mono); color: rgba(255,255,255,.18); text-align: center; font-style: normal; }
.sb-cell { position: absolute; left: calc(44px + 120px * 7); top: calc(30px + 34px * 4); width: 120px; height: 34px; border: 2px solid var(--sel); box-shadow: 0 0 0 4px rgba(46,211,166,.12), 0 0 30px rgba(46,211,166,.25); animation: kCell 9s steps(1) infinite; }
.sb-cell::after { content: ''; position: absolute; right: -5px; bottom: -5px; width: 8px; height: 8px; background: var(--sel); border: 1px solid var(--ink); }
@keyframes kCell { 0% { transform: translate(0, 0); } 25% { transform: translate(120px, 68px); } 50% { transform: translate(-240px, 136px); } 75% { transform: translate(240px, -34px); } }
.k-hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: clamp(28px, 4vw, 64px); align-items: end; }
.k-hero h1 { font: 600 clamp(36px, 5.4vw, 72px)/1.02 var(--display); letter-spacing: -.025em; margin: 18px 0 0; text-wrap: balance; }
.k-hero .sub { max-width: 620px; }

/* formula bar: =КУРС(«…») types itself */
.fx { display: flex; align-items: stretch; margin-top: 22px; max-width: 640px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(13,16,22,.8); overflow: hidden; font: 500 14px/1 var(--mono); }
.fx-name { padding: 11px 14px; color: var(--muted); border-right: 1px solid var(--line-2); min-width: 58px; text-align: center; }
.fx-ico { padding: 11px 12px; color: var(--teal); font-style: italic; font-weight: 700; border-right: 1px solid var(--line-2); }
.fx-text { padding: 11px 14px; color: #E9ECF2; white-space: nowrap; overflow: hidden; flex: 1; }
.fx-type { display: inline-block; overflow: hidden; vertical-align: bottom; max-width: 100%; border-right: 2px solid var(--amber); animation: fxType 2.2s steps(40) .3s both, fxCaret .9s steps(1) infinite; }
@keyframes fxType { from { max-width: 0; } }
@keyframes fxCaret { 50% { border-color: transparent; } }

.k-meta { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.k-meta li { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font-size: 14px; }
.k-meta b { color: var(--text); font-weight: 800; }

/* price: a selected cell with a fill handle */
.k-price { position: relative; display: grid; gap: 10px; padding: 26px 24px 24px; border-radius: 18px; background: linear-gradient(180deg, rgba(46,211,166,.08), rgba(17,20,27,.95) 40%); border: 2px solid var(--sel); box-shadow: 0 30px 80px -40px rgba(46,211,166,.55); }
.k-price::after { content: ''; position: absolute; right: -6px; bottom: -6px; width: 11px; height: 11px; border-radius: 2px; background: var(--sel); border: 2px solid var(--ink); }
.k-price-ref { position: absolute; top: -12px; left: 18px; padding: 2px 8px; border-radius: 6px; background: var(--sel); color: var(--ink); font: 800 12px/1.4 var(--mono); }
.k-price small { color: var(--muted); font-size: 13px; }
.k-price-v { font: 600 clamp(34px, 3.4vw, 46px)/1 var(--display); letter-spacing: -.02em; }
.k-price-note { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.k-price .btn { justify-content: center; }
.k-unlocked { margin: 0; color: var(--teal); font-weight: 700; font-size: 14px; }

/* ---------- player «theatre» */
.k-watch { padding: 18px 0 40px; }
.player { position: relative; border-radius: 18px; background: #07090d; border: 1px solid var(--line-2); box-shadow: 0 60px 120px -60px rgba(0,0,0,.95); overflow: hidden; }
.pl-screen { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.pl-screen video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.pl-screen video::cue { background: rgba(8,10,14,.82); color: #fff; font-family: var(--sans); font-size: clamp(14px, 2.2vw, 26px); line-height: 1.35; }
.pl-poster { position: absolute; inset: 0; background: #000 center / cover no-repeat; transition: opacity .35s; }
.player.started .pl-poster { opacity: 0; pointer-events: none; }
.pl-big { position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%; border: 0; background: var(--amber); color: #111; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(240,166,47,.18), 0 20px 50px -10px rgba(240,166,47,.6); transition: transform .3s var(--ease), opacity .3s; }
.pl-big svg { width: 36px; height: 36px; fill: currentColor; margin-left: 4px; }
.pl-big:hover { transform: scale(1.06); }
.player.playing .pl-big, .player.locked .pl-big { opacity: 0; pointer-events: none; }
.pl-wm { position: absolute; right: 3%; top: 4%; font: 600 12px/1 var(--mono); color: rgba(255,255,255,.22); pointer-events: none; transition: top 1s, right 1s; text-shadow: 0 1px 2px #000; }
.pl-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: radial-gradient(60% 60% at 50% 50%, rgba(11,13,18,.72), rgba(11,13,18,.94)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pl-lock b { font: 600 clamp(20px, 2.4vw, 28px)/1.2 var(--display); }
.pl-lock span { color: var(--muted); max-width: 420px; }
.pl-lock-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.pl-next { position: absolute; right: 18px; bottom: 74px; display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; background: rgba(17,20,27,.92); border: 1px solid var(--line-2); max-width: 300px; }
.pl-next span { color: var(--muted); font-size: 12px; }
.pl-next b { font-size: 15px; }
/* control bar */
.pl-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.8)); transition: opacity .3s; }
.player.playing.idle .pl-bar { opacity: 0; }
.player:not(.started) .pl-bar { opacity: 0; pointer-events: none; }
.pl-seek { position: relative; height: 16px; display: flex; align-items: center; }
.pl-seek::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
.pl-buf, .pl-cur { position: absolute; left: 0; height: 4px; border-radius: 2px; pointer-events: none; }
.pl-buf { background: rgba(255,255,255,.3); width: 0; }
.pl-cur { background: linear-gradient(90deg, var(--amber), var(--teal)); width: 0; }
.pl-marks { position: absolute; inset: 0; pointer-events: none; }
.pl-marks i { position: absolute; top: 6px; width: 3px; height: 4px; background: #0b0d12; }
.pl-seek input { position: relative; z-index: 1; width: 100%; margin: 0; height: 16px; opacity: 0; cursor: pointer; }
.pl-ctrls { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pl-ctrls button { height: 34px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: 700 13px/1 var(--sans); cursor: pointer; display: grid; place-items: center; }
.pl-ctrls button:hover, .pl-ctrls button[aria-pressed="true"] { background: rgba(255,255,255,.12); }
.pl-ctrls svg { width: 20px; height: 20px; fill: currentColor; }
.pl-fs svg { fill: none; stroke: currentColor; stroke-width: 2; }
.pl-play .i-pause, .player.playing .pl-play .i-play { display: none; }
.player.playing .pl-play .i-pause { display: inline; }
.pl-time { font: 600 13px/1 var(--mono); color: #E9ECF2; white-space: nowrap; }
.pl-chap { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-sp { flex: 1; }
.pl-menu-w { position: relative; }
.pl-menu { position: absolute; right: 0; bottom: 42px; min-width: 130px; padding: 6px; border-radius: 12px; background: rgba(17,20,27,.97); border: 1px solid var(--line-2); display: grid; gap: 2px; }
.pl-menu button { justify-content: start; display: flex; width: 100%; padding: 8px 10px; font-weight: 600; }
.pl-menu button[aria-checked="true"] { color: var(--amber); }
/* sheet tabs = lessons */
.pl-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 10px; background: #0d1016; border-top: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.pl-tabs::-webkit-scrollbar { display: none; }
.pl-tabs .tab { flex: none; padding: 10px 16px; border: 0; border-top: 3px solid transparent; background: transparent; color: var(--muted); font: 600 13px/1 var(--sans); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.pl-tabs .tab::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); }
.pl-tabs .tab.free::before { background: var(--teal); }
.pl-tabs .tab.done::before { background: var(--amber); }
.pl-tabs .tab[aria-selected="true"] { color: #fff; background: #161b24; border-top-color: var(--sel); }
.pl-tabs-add { align-self: center; color: rgba(255,255,255,.25); padding: 0 12px; font-size: 18px; }
/* now playing: chapters + files */
.k-now { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; margin-top: 22px; }
.k-now-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.k-now-ref { font: 700 12px/1 var(--mono); color: var(--amber); }
.k-now-title { margin: 0; font: 600 clamp(20px, 2.2vw, 28px)/1.2 var(--display); letter-spacing: -.01em; }
.k-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.k-chapters button { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font: 600 13px/1.2 var(--sans); cursor: pointer; }
.k-chapters button em { font: 700 12px/1 var(--mono); color: var(--teal); font-style: normal; }
.k-chapters button.on { border-color: var(--sel); background: rgba(46,211,166,.08); }
.k-files { display: grid; gap: 8px; align-content: start; }
.k-files b { font-size: 13px; color: var(--muted); }
.k-files a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: rgba(33,163,102,.12); border: 1px solid rgba(33,163,102,.4); color: #e8fff4; text-decoration: none; font-weight: 600; font-size: 14px; }

/* ---------- programme as a sheet */
.k-sheet { border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; background: var(--ink-2); }
.k-sheet .c { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; align-items: center; min-width: 0; }
.k-sheet .c:last-child { border-right: 0; }
.k-sheet-head, .k-sheet .row, .k-sheet-sum { display: grid; grid-template-columns: 56px minmax(0, 1fr) 110px 170px; }
.k-sheet-head { background: #0e1219; font: 700 11.5px/1 var(--mono); color: var(--muted); letter-spacing: .04em; }
.k-sheet-head .c { padding: 10px 16px; }
.k-sheet .row { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; position: relative; }
.k-sheet .row:hover { background: rgba(255,255,255,.025); }
.k-sheet .row.on { background: rgba(46,211,166,.05); }
.k-sheet .row.on::after { content: ''; position: absolute; inset: -1px; border: 2px solid var(--sel); pointer-events: none; }
.k-sheet .n { justify-content: center; font: 700 13px/1 var(--mono); color: var(--muted); background: #0e1219; }
.k-sheet .t { flex-direction: column; align-items: flex-start; gap: 4px; }
.k-sheet .t b { font-size: 16px; font-weight: 700; }
.k-sheet .t small { color: var(--muted); font-size: 13.5px; }
.k-sheet .d { font: 600 13px/1 var(--mono); color: var(--muted); justify-content: flex-end; }
.k-sheet .s { gap: 10px; justify-content: space-between; }
.st { font-style: normal; font: 700 12px/1 var(--sans); padding: 6px 9px; border-radius: 7px; }
.st.free { background: rgba(46,211,166,.14); color: var(--teal); }
.st.lock { background: rgba(255,255,255,.06); color: var(--muted); }
.st.open { background: rgba(240,166,47,.14); color: var(--amber); }
.prog { width: 46px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); position: relative; overflow: hidden; }
.prog::after { content: ''; position: absolute; inset: 0; width: calc(var(--p) * 100%); background: var(--amber); }
.k-sheet-sum { border-top: 2px solid var(--line-2); background: #0e1219; font: 600 13px/1 var(--mono); color: var(--muted); }
.k-sheet-sum .t { color: var(--teal); flex-direction: row; }
.k-total-prog { color: var(--amber); margin-right: 4px; }

/* learn / steps */
.k-learn { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.k-learn li { position: relative; padding: 18px 18px 18px 74px; border-radius: var(--r-sm); background: var(--ink-2); border: 1px solid var(--line); font-weight: 600; }
.k-learn .ref { position: absolute; left: 16px; top: 16px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--sel); color: var(--teal); font: 700 12px/1 var(--mono); }
.k-steps { list-style: none; counter-reset: ks; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.k-steps li { counter-increment: ks; position: relative; padding: 52px 20px 20px; border-radius: var(--r-sm); background: var(--ink-2); border: 1px solid var(--line); display: grid; gap: 8px; }
.k-steps li::before { content: counter(ks, decimal-leading-zero); position: absolute; left: 20px; top: 18px; font: 700 13px/1 var(--mono); color: var(--amber); }
.k-steps b { font: 600 17px/1.25 var(--display); }
.k-steps span { color: var(--muted); font-size: 14.5px; }

/* ---------- code dialog */
.k-code { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(6,8,12,.75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.k-code[hidden] { display: none; }
.k-code-box { position: relative; width: min(440px, 100%); display: grid; gap: 12px; padding: 30px 26px 26px; border-radius: 20px; background: var(--ink-2); border: 2px solid var(--sel); box-shadow: 0 40px 100px -30px #000; }
.k-code-box h3 { margin: 0; font: 600 24px/1.2 var(--display); }
.k-code-box p { margin: 0; color: var(--muted); font-size: 14.5px; }
.k-code-ref { position: absolute; top: -13px; left: 20px; padding: 2px 9px; border-radius: 6px; background: var(--sel); color: var(--ink); font: 800 italic 13px/1.4 var(--mono); }
.k-code-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
.k-code-box input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: #0b0e14; color: #fff; font: 700 18px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.k-code-box input:focus { outline: 2px solid var(--sel); outline-offset: 1px; }
.k-code-err { color: #ff8a78 !important; }

/* ---------- catalog */
.k-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.k-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-md); overflow: hidden; background: var(--ink-2); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .3s, transform .4s var(--ease); }
.k-card:hover { border-color: var(--sel); transform: translateY(-3px); }
.k-card-tab { position: absolute; z-index: 1; left: 14px; top: 14px; padding: 6px 10px; border-radius: 8px; background: rgba(11,13,18,.85); border: 1px solid var(--line-2); font: 700 12px/1 var(--sans); }
.k-card-img { aspect-ratio: 16 / 9; background: #07090d; }
.k-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-card-body { display: grid; gap: 8px; padding: 18px 20px 20px; }
.k-card-ref { font: 700 12px/1 var(--mono); color: var(--teal); }
.k-card-body b { font: 600 21px/1.25 var(--display); }
.k-card-body > span:not(.k-card-ref):not(.k-card-foot) { color: var(--muted); font-size: 14.5px; }
.k-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.k-card-foot .price { color: var(--amber); font-weight: 800; font-size: 16px; }
.k-empty { color: var(--muted); font-size: 17px; }

@media (max-width: 980px) {
  .k-hero-in { grid-template-columns: minmax(0, 1fr); }
  .k-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-now { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .k-hero { padding-top: 104px; }
  .sb-cell { display: none; }
  .k-learn, .k-steps { grid-template-columns: minmax(0, 1fr); }
  .k-sheet-head, .k-sheet .row, .k-sheet-sum { grid-template-columns: 40px minmax(0, 1fr) 96px; }
  .k-sheet .d { display: none; }
  .k-sheet .c { padding: 12px 10px; }
  .pl-chap, .pl-speed-w { display: none; }
  .pl-ctrls { gap: 2px; }
  .pl-big { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .pl-big svg { width: 28px; height: 28px; }
  .pl-next { left: 12px; right: 12px; bottom: 64px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .sb-cell, .fx-type { animation: none; } }

/* ---------- teaching model: per-student lessons, homework, teacher */
.k-hello { margin: 0; font: 600 16px/1.35 var(--display); color: var(--teal); }
.pl-wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; background: radial-gradient(60% 60% at 50% 50%, rgba(11,13,18,.7), rgba(11,13,18,.94)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pl-wait b { font: 600 clamp(20px, 2.4vw, 28px)/1.2 var(--display); }
.pl-wait span { color: var(--muted); max-width: 460px; }
.player.waiting .pl-big { opacity: 0; pointer-events: none; }
.k-mod { display: grid; grid-template-columns: 56px minmax(0, 1fr); border-top: 1px solid var(--line); background: rgba(240,166,47,.06); }
.k-mod .c { padding: 10px 16px; font: 700 13px/1.2 var(--sans); color: var(--amber); letter-spacing: .02em; }
.k-mod .n { justify-content: center; background: #0e1219; color: var(--amber); }
.st.next { background: rgba(46,211,166,.1); color: var(--teal); }
.k-teacher { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; border-radius: var(--r-md); background: var(--ink-2); border: 1px solid var(--line); }
.k-teacher img { width: 180px; height: 180px; border-radius: 16px; object-fit: cover; border: 2px solid var(--sel); }
.k-teacher b { display: block; font: 600 26px/1.2 var(--display); margin: 8px 0; }
.k-teacher p { margin: 0 0 8px; color: var(--muted); max-width: 640px; }
.k-teacher-ref, .k-extra-ref { font: 700 12px/1 var(--mono); color: var(--teal); }
.k-teacher-sup { color: var(--text) !important; font-weight: 600; }
.k-extra { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 14px; padding: 22px 24px; border-radius: var(--r-sm); border: 1px dashed rgba(240,166,47,.5); background: rgba(240,166,47,.05); }
.k-extra > div:first-child { display: grid; gap: 6px; max-width: 560px; }
.k-extra b { font: 600 19px/1.25 var(--display); }
.k-extra span:not(.k-extra-ref) { color: var(--muted); font-size: 14.5px; }
.k-extra-buy { display: flex; align-items: center; gap: 16px; }
.k-extra-buy b { font-size: 24px; color: var(--amber); }
@media (max-width: 700px) {
  .k-teacher { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .k-teacher img { width: 120px; height: 120px; }
  .k-mod { grid-template-columns: 40px minmax(0, 1fr); }
}
/* panels with their own display must still obey the hidden attribute */
.pl-lock[hidden], .pl-wait[hidden], .pl-next[hidden], .k-files[hidden], .k-hello[hidden], .k-unlocked[hidden], .k-hw[hidden], .pl-menu[hidden] { display: none !important; }
.k-price-v { white-space: nowrap; }
.k-price-v span { font: 600 .42em/1 var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
@media (max-width: 700px) { .k-sheet-sum .s { font-size: 11px; } }
.k-code-legal { font-size: 12.5px !important; } .k-code-legal a { color: var(--teal); }

/* ---------- level check: a formula bar asks, answer cells reply */
.k-quiz { margin-top: 56px; }
.k-quiz-box { position: relative; padding: clamp(22px, 3vw, 34px); border-radius: var(--r-md); background: radial-gradient(90% 120% at 100% 0%, rgba(46,211,166,.10), transparent 60%), var(--ink-2); border: 1px solid var(--line-2); }
.k-quiz-intro { display: grid; gap: 10px; justify-items: start; max-width: 620px; }
.k-quiz-intro h2 { margin: 0; font: 600 clamp(24px, 3vw, 34px)/1.15 var(--display); letter-spacing: -.015em; }
.k-quiz-intro p { margin: 0 0 6px; color: var(--muted); }
.k-quiz-ref { font: 700 12px/1 var(--mono); color: var(--teal); }
.k-quiz-run[hidden], .k-quiz-intro[hidden] { display: none !important; }
.k-quiz-run { display: grid; gap: 16px; max-width: 760px; }
.kq-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kq-step { font: 700 13px/1 var(--mono); color: var(--muted); }
.kq-cells { display: flex; gap: 4px; }
.kq-cells i { width: 26px; height: 12px; border: 1px solid var(--line-2); border-radius: 3px; }
.kq-cells i.done { background: var(--teal); border-color: var(--teal); }
.kq-cells i.bad { background: rgba(255,138,120,.75); border-color: transparent; }
.kq-cells i.cur { border: 2px solid var(--sel); }
.kq-fx { margin-top: 0; }
.kq-grid { display: grid; grid-template-columns: 44px 120px; width: max-content; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; font: 600 14px/1 var(--mono); }
.kq-grid span { padding: 8px 12px; border-top: 1px solid var(--line); }
.kq-grid span:nth-child(-n+2) { border-top: 0; }
.kq-ref { background: #0e1219; color: var(--muted); text-align: center; }
.kq-val { text-align: right; }
.kq-q { margin: 0; font: 600 clamp(17px, 1.8vw, 20px)/1.4 var(--sans); outline: none; }
.kq-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; }
.kq-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #0d1017; color: var(--text); font: 600 15px/1.3 var(--sans); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.kq-opt:hover { border-color: var(--sel); }
.kq-opt.picked { border: 2px solid var(--sel); background: rgba(46,211,166,.08); }
.kq-key { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: #0e1219; color: var(--muted); font: 700 12px/1 var(--mono); }
.kq-skip { color: var(--muted); justify-content: center; }
.k-quiz-run.wait .kq-opt { pointer-events: none; }
.kq-res { display: flex; gap: 20px; align-items: center; }
.kq-score { flex: none; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 14px; border: 2px solid var(--sel); font: 600 40px/1 var(--display); }
.kq-score small { font-size: 16px; color: var(--muted); }
.kq-res h3 { margin: 0 0 6px; font: 600 clamp(20px, 2.4vw, 26px)/1.2 var(--display); outline: none; }
.kq-res p { margin: 0; color: var(--muted); }
.kq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kq-list li { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.025); }
.kq-list b { font-weight: 600; font-size: 14.5px; }
.kq-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.kq-mark { flex: none; width: 22px; font-weight: 800; color: var(--teal); }
.kq-list .no .kq-mark { color: #ff8a78; }
.kq-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kq-again { border: 0; background: none; color: var(--muted); font: 600 14px/1 var(--sans); text-decoration: underline; cursor: pointer; padding: 10px; }
.k-mod .t { flex-wrap: wrap; gap: 6px 12px; }
.k-mod.rec { background: rgba(46,211,166,.12); box-shadow: inset 0 0 0 2px var(--sel); }
.k-mod.rec .t::after { content: "Рекомендуем начать здесь"; padding: 3px 8px; border-radius: 6px; background: var(--sel); color: var(--ink); font: 700 11.5px/1.3 var(--sans); }

/* ---------- comparison: on your own vs this course */
.k-cmp { border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; background: var(--ink-2); }
.k-cmp-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.k-cmp-row:first-child { border-top: 0; }
.k-cmp .c { padding: 14px 18px; border-right: 1px solid var(--line); font-size: 15px; }
.k-cmp .c:last-child { border-right: 0; }
.k-cmp .h { background: #0e1219; font: 700 13px/1.4 var(--mono); color: var(--muted); }
.k-cmp .no { color: var(--muted); }
.k-cmp .yes { position: relative; padding-left: 42px; font-weight: 600; background: rgba(46,211,166,.04); }
.k-cmp .yes::before { content: "✓"; position: absolute; left: 18px; top: 14px; color: var(--teal); font-weight: 800; }
.k-cmp-head .c { font: 700 13px/1.4 var(--sans); padding-top: 12px; padding-bottom: 12px; background: #0e1219; color: var(--muted); }
.k-cmp-head .yes { color: var(--teal); background: rgba(46,211,166,.10); padding-left: 18px; }
.k-cmp-head .yes::before { content: none; }

/* ---------- reviews about our Excel work */
.k-rev-note { margin: -6px 0 18px; color: var(--muted); max-width: 720px; }
.k-rev-note b { color: var(--amber); }
.k-revs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.k-revs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.k-revs .rev blockquote { font-size: 15px; }
.k-revs .rev-big blockquote { font-size: 16px; }

/* ---------- catalog: subjects and free-lesson tag */
.k-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.k-chips button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 14px/1 var(--sans); cursor: pointer; }
.k-chips button.on { background: var(--sel); border-color: var(--sel); color: var(--ink); }
.k-card[hidden] { display: none; }
.k-card-free { position: absolute; z-index: 1; right: 14px; top: 14px; padding: 6px 10px; border-radius: 8px; background: var(--amber); color: var(--ink); font: 800 12px/1 var(--sans); }

@media (max-width: 980px) {
  .k-revs { grid-template-columns: minmax(0, 1fr); }
  .kq-opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .kq-opts, .k-revs-grid { grid-template-columns: minmax(0, 1fr); }
  .kq-res { align-items: flex-start; }
  .kq-score { width: 72px; height: 72px; font-size: 30px; }
  .k-cmp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .k-cmp .h { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 14px; }
  .k-cmp-head .h { display: none; }
  .k-cmp .c { padding: 12px 14px; font-size: 14px; }
  .k-cmp .yes { padding-left: 34px; }
  .k-cmp .yes::before { left: 14px; top: 12px; }
}
.k-revs figure.rev { margin: 0; }

/* homework: MAX first, then Telegram */
.k-hw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 4px; font-size: 14px; }
.k-hw > span:first-child { color: var(--muted); }
.k-hw a { color: var(--teal); font-weight: 700; text-decoration: none; }
.k-hw a:hover { text-decoration: underline; }
.k-hw-tip { flex-basis: 100%; color: var(--teal); font-size: 13px; }
.pl-lock-btns .k-hw-tip { text-align: center; }
[data-homework][hidden], .k-hw-tip[hidden] { display: none !important; }

/* =========================================================================
   «От пустого листа до дашборда»: one workbook on a sticky stage; every step
   of the course changes it. State lives in .kx-book[data-stage="0..4"].
   ========================================================================= */
.kx { position: relative; padding: clamp(56px, 8vw, 110px) 0 20px; }
.kx-head { max-width: 760px; }
.kx-head h2 { margin: 0; font: 600 clamp(30px, 4.4vw, 58px)/1.05 var(--display); letter-spacing: -.025em; }
.kx-head .sub { margin-top: 16px; }
.kx-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(28px, 4vw, 64px); margin-top: 28px; }
.kx-stage { position: sticky; top: max(90px, calc(50vh - 250px)); align-self: start; z-index: 2; }
.kx-steps { list-style: none; margin: 0; padding: 0; }
.kx-step { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; gap: 12px; opacity: .28; transition: opacity .5s var(--ease); }
.kx-step:first-child { min-height: 100vh; padding-top: 30vh; } /* the empty sheet holds for a while once the stage sticks */
.kx-step:last-child { min-height: 70vh; }
.kx-step.on { opacity: 1; }
.kx-sh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 700 13px/1 var(--mono); color: var(--teal); }
.kx-n { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); font: 600 12px/1 var(--sans); }
.kx-step h3 { margin: 0; font: 600 clamp(24px, 2.4vw, 32px)/1.15 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.kx-step p { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 460px; }
.kx-skills { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kx-skills li { padding: 7px 11px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }

/* the workbook */
.kx-book { --cell: 12.5px; position: relative; border-radius: 16px; background: #0c1016; border: 1px solid var(--line-2); box-shadow: 0 50px 120px -50px rgba(0,0,0,.95), 0 0 0 1px rgba(46,211,166,.04); overflow: hidden; font: 500 var(--cell)/1 var(--mono); }
.kx-book em { font-style: normal; }
.kx-book [class^="s"], .kx-book [class*=" s"] { display: none; }
.kx-book[data-stage="0"] .s0, .kx-book[data-stage="1"] .s1, .kx-book[data-stage="2"] .s2,
.kx-book[data-stage="3"] .s3, .kx-book[data-stage="4"] .s4 { display: inline; }
.kx-book[data-stage="0"] .kx-dash .s3, .kx-book[data-stage="1"] .kx-dash .s3, .kx-book[data-stage="2"] .kx-dash .s3 { display: inline; }
.kx-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #121722; border-bottom: 1px solid var(--line); font: 600 13px/1 var(--sans); }
.kx-top b { font-weight: 700; color: #DDE2EA; }
.kx-dots { display: flex; gap: 6px; }
.kx-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a313d; }
.kx-run { margin-left: auto; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--muted); font: 700 12px/1 var(--sans); transition: background .4s, color .4s, box-shadow .4s, transform .2s; }
.kx-book[data-stage="4"] .kx-run { background: var(--amber); border-color: var(--amber); color: var(--ink); box-shadow: 0 0 0 6px rgba(240,166,47,.18); animation: kxPress 1.6s var(--ease) .2s both; }
@keyframes kxPress { 20% { transform: scale(.92); } 40% { transform: none; } }
.kx-fx { display: flex; border-bottom: 1px solid var(--line); background: #0e131b; }
.kx-fx > span { padding: 9px 12px; border-right: 1px solid var(--line); white-space: nowrap; }
.kx-fx .n { min-width: 56px; text-align: center; color: var(--muted); }
.kx-fx .f { color: var(--teal); font-style: italic; font-weight: 700; }
.kx-fx .t { flex: 1; border-right: 0; color: #E9ECF2; overflow: hidden; text-overflow: ellipsis; }
.kx-book[data-stage="0"] .kx-fx .t .s0 { color: var(--amber); animation: fxCaret .9s steps(1) infinite; }

.kx-body { position: relative; height: 352px; overflow: hidden; }
.kx-sheet .r { display: grid; grid-template-columns: 34px 64px 96px 92px 86px 84px minmax(0, 1fr); border-bottom: 1px solid rgba(255,255,255,.05); }
.kx-sheet .r > span { padding: 9px 10px; border-right: 1px solid rgba(255,255,255,.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #D7DCE4; }
.kx-sheet .h { background: #111620; color: #5F6672 !important; text-align: center; padding-left: 0 !important; padding-right: 0 !important; }
.kx-sheet .hd > span { background: #111620; color: #6E7581; font-weight: 700; font-size: 11px; transition: background .5s, color .5s; }
.kx-sheet .num { text-align: right; }
/* stage 0: an empty sheet, the cursor waits in A2 */
.kx-sheet .r:not(.hd):not(.e) > span:not(.h) { opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s, background .5s, color .5s; transition-delay: calc(var(--i, 0) * 55ms); }
.kx-book[data-stage="0"] .kx-sheet .r[style*="--i:0"] > span:nth-child(2) { opacity: 1; transform: none; box-shadow: inset 0 0 0 2px var(--sel); }
/* stage 1+: data and the total */
.kx-book:not([data-stage="0"]) .kx-sheet .r > span:not(.h):not(.vlk) { opacity: 1; transform: none; }
.kx-sheet .tot > span { transition-delay: .45s !important; font-weight: 700; }
.kx-book[data-stage="1"] .kx-sheet .tot .num { box-shadow: inset 0 0 0 2px var(--sel); color: var(--teal); background: rgba(46,211,166,.08); }
/* stage 2+: smart table, ВПР fills the region column, pivot slides in */
.kx-book[data-stage="2"] .kx-sheet .vlk, .kx-book[data-stage="3"] .kx-sheet .vlk, .kx-book[data-stage="4"] .kx-sheet .vlk { opacity: 1; transform: none; color: var(--teal); }
.kx-book[data-stage="2"] .kx-sheet .hd > span:not(.h), .kx-book[data-stage="3"] .kx-sheet .hd > span:not(.h), .kx-book[data-stage="4"] .kx-sheet .hd > span:not(.h) { background: #12352c; color: #BFF5E4; }
.kx-book[data-stage="2"] .kx-sheet .r:nth-child(odd):not(.hd):not(.e) > span:not(.h) { background: rgba(46,211,166,.045); }
.kx-pivot { position: absolute; right: 14px; top: 44px; width: min(214px, calc(100% - 476px)); min-width: 180px; display: grid; border-radius: 10px; overflow: hidden; background: #101822; border: 1px solid rgba(46,211,166,.45); box-shadow: 0 30px 60px -20px #000; opacity: 0; transform: translateX(30px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.kx-pivot b { padding: 9px 12px; font: 700 12px/1 var(--sans); color: var(--teal); background: #12352c; }
.kx-pivot span { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.05); }
.kx-pivot span:nth-of-type(1) { color: var(--muted); font-size: 11px; }
.kx-pivot .pt { font-weight: 700; color: var(--teal); }
.kx-pivot i { font-style: normal; }
.kx-book[data-stage="2"] .kx-pivot { opacity: 1; transform: none; transition-delay: .35s; }
/* stage 3+: the dashboard covers the sheet */
.kx-dash { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 14px; background: radial-gradient(90% 90% at 100% 0%, rgba(240,166,47,.08), transparent 60%), #0c1016; opacity: 0; transform: scale(.96); pointer-events: none; transition: opacity .55s var(--ease), transform .7s var(--ease); font-family: var(--sans); }
.kx-book[data-stage="3"] .kx-dash, .kx-book[data-stage="4"] .kx-dash { opacity: 1; transform: none; }
.kx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kx-kpis > span { padding: 12px 14px; border-radius: 10px; background: #121823; border: 1px solid var(--line); }
.kx-kpis small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kx-kpis b { display: block; margin-top: 6px; font: 600 clamp(15px, 1.5vw, 21px)/1 var(--display); color: #fff; white-space: nowrap; }
.kx-kpis > span:first-child b { color: var(--amber); }
.kx-chart { display: grid; grid-template-rows: auto 1fr; gap: 8px; padding: 12px 14px; border-radius: 10px; background: #121823; border: 1px solid var(--line); min-height: 0; }
.kx-chart small { color: var(--muted); font-size: 12px; font-weight: 600; }
.kx-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: end; min-height: 0; padding-top: 18px; }
.kx-bar { position: relative; height: 100%; display: grid; grid-template-rows: 1fr auto; align-items: end; }
.kx-bar i { display: block; height: 0; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--teal), #1a8f71); transition: height .9s var(--ease); }
.kx-bar:first-child i { background: linear-gradient(180deg, var(--amber), #b97a10); }
.kx-bar b { position: absolute; left: 0; right: 0; bottom: calc(var(--h, 0%) + 26px); text-align: center; font: 700 12px/1 var(--mono); color: #E9ECF2; transition: bottom .9s var(--ease); }
.kx-bar > span { padding-top: 7px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.kx-book[data-stage="3"] .kx-bar { --h: calc(var(--a) * .78); }
.kx-book[data-stage="4"] .kx-bar { --h: calc(var(--b) * .78); }
.kx-book[data-stage="3"] .kx-bar i, .kx-book[data-stage="4"] .kx-bar i { height: var(--h); transition-delay: .25s; }
.kx-ch-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 26px; }
.kx-toast { padding: 6px 10px; border-radius: 8px; background: var(--teal); color: var(--ink); font: 700 12px/1.2 var(--sans); white-space: nowrap; opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .5s var(--ease); }
.kx-book[data-stage="4"] .kx-toast { opacity: 1; transform: none; transition-delay: .9s; }
/* sheet tabs = modules */
.kx-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 10px; background: #111620; border-top: 1px solid var(--line); font: 600 12.5px/1 var(--sans); overflow: hidden; }
.kx-tabs span { padding: 10px 14px; color: var(--muted); border-top: 2px solid transparent; white-space: nowrap; transition: color .3s, background .3s, border-color .3s; }
.kx-tabs .add { color: #4b525e; }
.kx-book[data-stage="1"] [data-t="1"], .kx-book[data-stage="2"] [data-t="2"], .kx-book[data-stage="3"] [data-t="3"], .kx-book[data-stage="4"] [data-t="4"] { color: #fff; background: #0c1016; border-top-color: var(--sel); }

/* =========================================================================
   «Пример проверки»: notes from the teacher on the cells that need fixing
   ========================================================================= */
.kc { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.kc-copy h2 { margin: 0 0 18px; }
.kc-points { list-style: none; counter-reset: kc; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.kc-points li { counter-increment: kc; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.kc-points li::before { content: counter(kc); flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--sel); color: var(--teal); font: 700 13px/1 var(--mono); }
.kc-demo { position: relative; padding: 150px 0 170px; }
.kc-label { position: absolute; left: 0; top: 104px; padding: 5px 10px; border-radius: 8px; border: 1px dashed var(--line-2); color: var(--muted); font: 600 12px/1 var(--sans); }
.kc-sheet { border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #0c1016; font: 500 13.5px/1 var(--mono); }
.kc-sheet .r { display: grid; grid-template-columns: 38px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid rgba(255,255,255,.05); }
.kc-sheet .r:last-child { border-bottom: 0; }
.kc-sheet .r > span { position: relative; padding: 12px 12px; min-height: 40px; border-right: 1px solid rgba(255,255,255,.05); color: #D7DCE4; }
.kc-sheet .r > span:nth-child(n+3) { text-align: right; }
.kc-sheet .h { background: #111620; color: #5F6672 !important; text-align: center !important; padding-left: 0 !important; padding-right: 0 !important; }
.kc-sheet .hd > span { background: #111620; color: #6E7581; font: 700 11px/1.2 var(--sans); }
.kc-sheet .bad { color: #ff8a78; }
.kc-sheet .bad::after { content: ''; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent #ff5a43 transparent transparent; }
[data-kc].go .kc-sheet .bad { background: rgba(255,90,67,.08); box-shadow: inset 0 0 0 2px rgba(255,90,67,.55); transition: background .4s .2s, box-shadow .4s .2s; }
.kc-note { position: absolute; z-index: 1; max-width: 290px; padding: 12px 14px; border-radius: 12px; background: #FFF4D6; color: #2a2414; font: 500 13.5px/1.45 var(--sans); box-shadow: 0 24px 50px -16px rgba(0,0,0,.8); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .45s var(--ease), transform .55s var(--ease); }
.kc-note b { display: block; margin-bottom: 3px; font-weight: 800; color: #8a5a00; }
.kc-note::before { content: ''; position: absolute; width: 14px; height: 14px; background: #FFF4D6; transform: rotate(45deg); }
.kc-note.n1 { right: 0; top: 0; }
.kc-note.n1::before { right: 70px; bottom: -6px; }
.kc-note.n2 { left: 34%; bottom: 52px; max-width: 300px; }
.kc-note.n2::before { left: 60px; top: -6px; }
.kc-ok { position: absolute; right: 0; bottom: 6px; padding: 9px 14px; border-radius: 10px; background: var(--teal); color: var(--ink); font: 800 13px/1 var(--sans); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .5s var(--ease); }
[data-kc].go .n1 { opacity: 1; transform: none; transition-delay: .5s; }
[data-kc].go .n2 { opacity: 1; transform: none; transition-delay: 1.3s; }
[data-kc].go .kc-ok { opacity: 1; transform: none; transition-delay: 2.2s; }

/* «Что вы получите»: two plain columns instead of two card grids */
.k-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.k-col-t { margin: 0 0 14px; font: 700 14px/1 var(--sans); color: var(--muted); }
.k-two .k-learn { grid-template-columns: minmax(0, 1fr); }
.k-whom { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.k-whom li { position: relative; padding: 16px 0 16px 38px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 16.5px; }
.k-whom li:first-child { border-top: 1px solid var(--line); }
.k-whom li::before { content: '✓'; position: absolute; left: 4px; top: 16px; color: var(--teal); font-weight: 800; }
.kurs #contact { margin-top: clamp(40px, 6vw, 80px); }

@media (max-width: 900px) {
  .kx-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kx-stage { top: 72px; margin: 0 -4px; padding: 10px 4px 12px; background: linear-gradient(180deg, var(--ink) 85%, rgba(11,13,18,0)); }
  .kx-book { --cell: 10.5px; }
  .kx-body { height: 236px; }
  .kx-sheet .r { grid-template-columns: 24px 0 minmax(0, 1fr) minmax(0, 1fr) 70px 58px 0; }
  .kx-sheet .r > span:last-child { padding: 0; border: 0; }
  .kx-sheet .r > span { padding: 7px 6px; }
  .kx-sheet .r > span:nth-child(2) { padding: 0; border: 0; }
  .kx-top { padding: 8px 10px; font-size: 11.5px; gap: 8px; }
  .kx-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kx-dots { display: none; }
  .kx-run { padding: 6px 8px; font-size: 11px; white-space: nowrap; }
  .kx-fx > span { padding: 7px 8px; }
  .kx-fx .n { min-width: 40px; }
  .kx-pivot { width: 172px; min-width: 0; top: 26px; right: 8px; }
  .kx-pivot span { padding: 6px 9px; }
  .kx-dash { padding: 10px; gap: 8px; }
  .kx-kpis { gap: 6px; }
  .kx-kpis > span { padding: 8px 9px; }
  .kx-kpis small { font-size: 10.5px; }
  .kx-kpis b { font-size: 13px; }
  .kx-chart { padding: 8px 10px; }
  .kx-bars { gap: 10px; padding-top: 14px; }
  .kx-toast { font-size: 10.5px; padding: 5px 7px; }
  .kx-ch-h small { font-size: 10.5px; }
  .kx-tabs { font-size: 11px; padding: 0 6px; }
  .kx-tabs span { padding: 8px 9px; }
  .kx-step, .kx-step:first-child, .kx-step:last-child { min-height: 58vh; justify-content: flex-start; padding-top: 18px; }
  .kx-step:first-child { padding-top: 48vh; min-height: 96vh; }
  .kx-step p { font-size: 15.5px; }
  .kc { grid-template-columns: minmax(0, 1fr); }
  .kc-demo { padding: 40px 0 0; }
  .kc-label { top: 0; }
  .kc .kc-note, .kc .kc-ok { position: relative; inset: auto; max-width: none; margin-top: 12px; }
  .kc .kc-ok { display: inline-block; }
  .kc-note::before { display: none; }
  .k-two { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .kx-book *, .kx-step, .kc-note, .kc-ok { transition: none !important; animation: none !important; }
}

/* fullscreen: real (.is-fs) or the in-page fallback (.pl-max) for in-app browsers */
.pl-fs .i-out, .player.is-fs .pl-fs .i-in, .player.pl-max .pl-fs .i-in { display: none; }
.player.is-fs .pl-fs .i-out, .player.pl-max .pl-fs .i-out { display: inline; }
.player.pl-max { position: fixed; inset: 0; z-index: 300; border: 0; border-radius: 0; display: flex; flex-direction: column; background: #000; box-shadow: none; }
.player.pl-max .pl-screen { flex: 1; aspect-ratio: auto; min-height: 0; }
.player.pl-max .pl-tabs { display: none; }
.pl-screen:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; }
html.pl-max-lock, html.pl-max-lock body { overflow: hidden; }
html.pl-max-lock .sticky-bar, html.pl-max-lock .fab { display: none !important; }

/* free-lesson-only mode */
.k-free-hw { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.k-free-hw a { color: var(--teal); font-weight: 700; }
.k-sheet .row.soon { cursor: default; opacity: .62; }
.k-sheet .row.soon:hover { background: transparent; }

/* price card: content never wider than the selected cell; opaque so nothing shows through */
.k-price { grid-template-columns: minmax(0, 1fr); background: linear-gradient(180deg, rgba(46,211,166,.08), transparent 40%), #11141b; }
.k-price-v.free { font-size: clamp(30px, 2.7vw, 40px); white-space: normal; }
.k-price-v.free span { display: block; margin: 8px 0 0; font-size: 15px; }
/* the wandering background cell crossed the content — the price card is the one selected cell */
.sb-cell { display: none; }
/* while the player is on screen the floating contact buttons step aside (they covered «Во весь экран») */
html.pl-onscreen .fab, html.pl-onscreen .sticky-bar { transform: translateY(140%) !important; pointer-events: none; }

/* ---------- catalog hero: how the learning works, a selected range B1:B4 */
.k-how { position: relative; align-self: center; padding: 24px 22px 18px; border-radius: 18px; border: 2px solid var(--sel);
  background: linear-gradient(180deg, rgba(46,211,166,.08), transparent 45%), #11141b; box-shadow: 0 30px 80px -40px rgba(46,211,166,.55); }
.k-how::after { content: ''; position: absolute; right: -6px; bottom: -6px; width: 11px; height: 11px; border-radius: 2px; background: var(--sel); border: 2px solid var(--ink); }
.k-how-t { display: block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.k-how ol { list-style: none; margin: 0; padding: 0; display: grid; }
.k-how li { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.06); border-radius: 10px; }
.k-how li:first-child { border-top: 0; }
.k-how .n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--muted); font: 700 13px/1 var(--mono); }
.k-how b { display: block; font-weight: 700; font-size: 15px; }
.k-how small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
/* the active cell walks down the steps: one row at a time, 10 s loop */
@media (prefers-reduced-motion: no-preference) {
  .k-how li { animation: kHow 10s calc(var(--i) * 2.5s) infinite; }
  .k-how li .n { animation: kHowN 10s calc(var(--i) * 2.5s) infinite; }
}
@keyframes kHow { 0%, 22% { background: rgba(46,211,166,.08); box-shadow: inset 0 0 0 1px rgba(46,211,166,.45); } 25%, 100% { background: transparent; box-shadow: none; } }
@keyframes kHowN { 0%, 22% { border-color: var(--sel); color: var(--teal); } 25%, 100% { border-color: var(--line-2); color: var(--muted); } }

/* ---------- catalog: a single course gets the whole row */
.k-cards:has(> .k-card.wide:only-child) { grid-template-columns: minmax(0, 1fr); }
.k-card.wide { flex-direction: row; }
.k-card.wide .k-card-img { flex: 1.15 1 0; aspect-ratio: 16 / 9; align-self: center; }
.k-card.wide .k-card-body { flex: 1 1 0; align-content: center; gap: 12px; padding: 28px 32px; }
.k-card.wide .k-card-body b { font-size: 30px; }
.k-card-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.k-card-mods i { font-style: normal; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.03); font-size: 13px; color: var(--text); }
.k-card-mods em { font: 700 11px/1 var(--mono); font-style: normal; color: var(--teal); padding: 3px 5px; border-radius: 5px; background: rgba(46,211,166,.1); }
.k-card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.k-card-stats > span { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.k-card-stats b { display: block; color: var(--text); font: 600 20px/1.1 var(--display); margin-bottom: 3px; }
.k-card-cta { justify-self: start; margin-top: 6px; }
.k-card.wide .k-card-foot { display: none; }
@media (max-width: 900px) {
  .k-card.wide { flex-direction: column; }
  .k-card.wide .k-card-img { flex: none; width: 100%; }
  .k-card.wide .k-card-body { padding: 20px; }
  .k-card.wide .k-card-body b { font-size: 24px; }
  .k-card-cta { justify-self: stretch; }
}
@media (max-width: 420px) { .k-card-stats b { font-size: 17px; } }
.k-card-body > .k-card-cta { color: var(--ink); font-size: 15px; }
.k-card-stats b { white-space: nowrap; font-size: 19px; }
.k-card.wide .k-card-img { align-self: stretch; aspect-ratio: auto; min-height: 320px; }
.k-card.wide .k-card-img img { object-position: left center; }
.k-how li { padding: 10px; }
.k-how small { font-size: 12.5px; }
.k-how-t { margin-bottom: 8px; }
@media (max-width: 900px) { .k-card.wide .k-card-img { aspect-ratio: 16 / 9; min-height: 0; } }
.k-card.wide .k-card-body > span.k-card-cta { color: var(--ink); }
@media (max-width: 700px) {
  .k-how { padding: 20px 14px 10px; }
  .k-how small { display: none; }
  .k-how li { padding: 8px 10px; align-items: center; }
}
/* catalog hero: copy sits level with the steps panel (no empty band above the title) */
.k-hero-cat .k-hero-in { align-items: center; }
.k-hero-cat { padding-bottom: 40px; }

/* «Поделиться уроком» in the lesson header */
.k-share { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); font: 600 13.5px/1.2 var(--sans); cursor: pointer; transition: border-color .2s, background .2s; }
.k-share:hover { border-color: var(--sel); }
.k-share svg { width: 16px; height: 16px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.k-share.ok { border-color: var(--sel); background: rgba(46,211,166,.1); }
@media (max-width: 700px) { .k-share { margin-left: 0; } }
