/* Ұстазхана — minimal design: warm white paper, near-black ink, one blue accent, one "lamp" yellow for highlights.
   The previous "Сабақ+ / Yasawi tiles" style is kept in _backup/style-sabaq-plus-2026-12-01/. */
:root {
  --paper: #fafaf7; --surface: #ffffff; --surface-2: #f1f1ec; --line: #e6e6df; --line-strong: #cfcfc6;
  --ink: #121212; --ink-2: #3d3d3a; --muted: #6b6b66;
  --cobalt: #0b6fb8; --cobalt-dark: #085a96; --cobalt-soft: #e8f1f9;
  --turq: #0b6fb8; --turq-soft: #e8f1f9; --sand: #b7861c; --sand-light: #f5c84c; --sand-soft: #fbf1d6;
  --madder: #b3261e; --madder-soft: #fbe7e5; --ok: #1f7a4a; --ok-soft: #e2f2e8;
  --night: #111214; --night-2: #1a1b1f; --night-3: #2a2b31; --night-line: #33343b; --night-ink: #f4f4f0; --night-muted: #a3a3a0;
  --serif: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --sans: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r-sm: 10px; --r-md: 14px; --r-lg: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: clip; }
a { color: var(--cobalt); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 4vw, 46px); }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(250, 250, 247, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; color: var(--cobalt); flex: none; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 23px; letter-spacing: -.04em; line-height: 1; }
.brand-name i { font-style: normal; color: var(--sand-light); }
.brand-name small { display: block; font-family: var(--sans); font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button.link { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); background: none; border: 0; cursor: pointer; font-weight: 500; }
.nav a:hover, .nav button.link:hover { color: var(--ink); background: var(--surface-2); }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; margin-left: 8px; }
.lang button { border: 0; background: none; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 600; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c2c2a; }
.btn-sand { background: var(--sand-light); color: #2b1f0b; }
.btn-sand:hover { background: #cfae76; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-lg { padding: 14px 24px; font-size: 17px; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-md); padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 32, 46, .12); }
.seg em { font-style: normal; font-size: 12px; color: var(--ok); margin-left: 6px; font-weight: 600; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.tag.soon { background: var(--sand-soft); color: #7a5a24; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- landing ---------- */
.hero { padding: 64px 0 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -.015em; max-width: 12em; }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 34em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.board { position: relative; background: var(--night); border-radius: 14px; padding: 14px; box-shadow: 0 30px 60px -30px rgba(14, 26, 43, .55); }
.board::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -14px; height: 14px; background: #c9ccc6; border-radius: 0 0 8px 8px; z-index: -1; }
.board-screen { aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; position: relative; background: var(--night-2) center / cover no-repeat; display: flex; align-items: flex-end; }
.board-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(14, 26, 43, .95) 0%, rgba(14, 26, 43, .6) 45%, rgba(14, 26, 43, .05) 75%); }
.board-screen .bs-text { position: relative; padding: 6% 7%; color: #fff; max-width: 62%; }
.board-screen .bs-text span { color: var(--sand-light); font-size: 13px; font-weight: 600; }
.board-screen .bs-text b { display: block; font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.12; margin-top: 6px; }
.board-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px 0; color: var(--night-muted); font-size: 12.5px; }
.board-bar i { display: inline-block; width: 40%; height: 3px; background: var(--night-3); border-radius: 2px; position: relative; overflow: hidden; vertical-align: middle; }
.board-bar i::after { content: ""; position: absolute; inset: 0 70% 0 0; background: var(--sand-light); }
.section { padding: 48px 0; }
.section > h2 { margin-bottom: 8px; }
.section > .sub { color: var(--ink-2); max-width: 46em; margin-bottom: 26px; }
.anatomy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line-strong); }
.anatomy > div { padding: 20px 22px 8px 0; }
.anatomy > div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.anatomy svg { width: 28px; height: 28px; color: var(--cobalt); margin-bottom: 12px; }
.anatomy h3 { font-size: 18px; margin-bottom: 6px; }
.anatomy p { color: var(--ink-2); font-size: 15px; }
.tile-band { height: 26px; background-color: var(--cobalt); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='26' viewBox='0 0 52 26'%3E%3Cg fill='none' stroke='%2337b5b8' stroke-width='1.6'%3E%3Cpath d='M13 2l4 7 7 4-7 4-4 7-4-7-7-4 7-4z'/%3E%3Cpath d='M39 2l4 7 7 4-7 4-4 7-4-7-7-4 7-4z'/%3E%3C/g%3E%3Cg fill='%23d9bd8c'%3E%3Ccircle cx='26' cy='13' r='2'/%3E%3Ccircle cx='0' cy='13' r='2'/%3E%3Ccircle cx='52' cy='13' r='2'/%3E%3C/g%3E%3C/svg%3E"); border-radius: 4px; margin: 8px 0 0; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.plan { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.plan + .plan { border-left: 1px solid var(--line); }
.plan.featured { background: var(--cobalt-soft); }
.plan h3 { font-size: 21px; margin: 0; }
.plan .note { font-size: 13.5px; color: var(--muted); min-height: 1.4em; }
.price { font-family: var(--serif); font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price small { font-family: var(--sans); font-size: 15px; font-weight: 400; color: var(--muted); }
.plan ul { margin: 4px 0 8px; padding: 0; list-style: none; display: grid; gap: 7px; color: var(--ink-2); font-size: 15px; }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; background: var(--turq); transform: rotate(45deg); }
.plan .btn { margin-top: auto; }

/* ---------- forms ---------- */
.auth-wrap { max-width: 460px; margin: 48px auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select { padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px var(--cobalt-soft); }
.form-error { background: var(--madder-soft); color: var(--madder); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.form-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 24px; margin: 8px 0 40px; align-items: start; }
.subject-pick { display: grid; gap: 8px; }
.subject-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; background: #fff; }
.subject-opt input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.subject-opt.disabled { opacity: .55; cursor: not-allowed; }
.subject-opt .tag { margin-left: auto; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-of-type { border-bottom: 0; }
.summary-row > .muted:first-child { flex: none; }
.total { font-family: var(--serif); font-size: 30px; font-weight: 600; }
.kaspi-btn { width: 100%; background: #e5352b; color: #fff; margin-top: 16px; }
.kaspi-btn:hover { background: #c92c23; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.success { text-align: center; padding: 44px 24px; }
.success .seal { width: 64px; height: 64px; margin: 0 auto 18px; color: var(--ok); }

/* ---------- cabinet ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 36px 0 22px; }
.page-head h1 { margin: 0; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--line-strong); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status.off::before { background: var(--sand); }
.status + .btn { margin-left: 10px; }
.list-head { font-family: var(--serif); font-size: 22px; margin: 28px 0 10px; }
.subj-list { border-top: 1px solid var(--line-strong); }
.subj-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
a.subj-row:hover { background: var(--surface); }
.subj-row .ic { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--cobalt-soft); color: var(--cobalt); }
.subj-row .ic svg { width: 26px; height: 26px; }
.subj-row h3 { margin: 0 0 2px; font-size: 21px; }
.subj-row p { margin: 0; color: var(--muted); font-size: 15px; }
.subj-row.locked { color: var(--muted); }
.subj-row.locked .ic { background: var(--surface-2); color: var(--muted); }
.ruler { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.ruler a, .ruler div { padding: 18px 10px 16px; text-align: center; text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.ruler > * + * { border-left: 1px solid var(--line); }
.ruler .num { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1; }
.ruler small { color: var(--muted); font-size: 13px; }
.ruler a:hover { background: var(--cobalt-soft); }
.ruler a[aria-current="true"] { background: var(--cobalt); color: #fff; }
.ruler a[aria-current="true"] small { color: #d6def2; }
.ruler div { color: var(--line-strong); }
.ruler div small { color: var(--line-strong); }
.topic-list { margin-top: 26px; border-top: 1px solid var(--line-strong); }
.topic { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.topic:hover { background: var(--surface); }
.topic .par { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--sand); line-height: 1.1; }
.topic h3 { margin: 0 0 4px; font-size: 22px; }
.topic p { margin: 0; color: var(--ink-2); font-size: 15.5px; max-width: 60em; }
.topic .meta { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; line-height: 1.7; }
.topic .thumb { width: 96px; aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--surface-2) center / cover no-repeat; }

/* ---------- lesson ---------- */
.lesson-cover { position: relative; margin: 24px 0 0; border-radius: var(--r-lg); overflow: hidden; background: var(--night) center / cover no-repeat; color: #fff; min-height: 300px; display: flex; align-items: flex-end; }
.lesson-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 26, 43, .96) 0%, rgba(14, 26, 43, .82) 45%, rgba(14, 26, 43, .25) 100%); }
.lesson-cover .inner { position: relative; padding: 32px 36px; max-width: 760px; }
.lesson-cover .crumbs, .lesson-cover .crumbs a { color: var(--night-muted); }
.lesson-cover .crumbs a:hover { color: #fff; }
.lesson-cover .par { font-family: var(--serif); font-size: 20px; color: var(--sand-light); font-weight: 600; }
.lesson-cover h1 { font-size: clamp(30px, 4vw, 50px); margin: 6px 0 12px; }
.lesson-cover .src { color: var(--night-muted); font-size: 14.5px; max-width: 48em; }
.lesson-cover .credit { position: absolute; right: 14px; bottom: 10px; font-size: 11.5px; color: rgba(255, 255, 255, .55); max-width: 40%; text-align: right; }
.mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.lesson-grid > *, .checkout > *, .acc-grid > *, .hero > * { min-width: 0; }
.block { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block > h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.block > h2 small { font-family: var(--sans); font-size: 14.5px; font-weight: 400; color: var(--muted); }
.filmstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 16px; }
.film { aspect-ratio: 16 / 9; border-radius: var(--r-sm); background: var(--night) center / cover no-repeat; position: relative; overflow: hidden; border: 0; cursor: pointer; padding: 0; text-align: left; }
.film::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 26, 43, .1), rgba(14, 26, 43, .85)); }
.film span { position: absolute; left: 10px; right: 10px; bottom: 8px; color: #fff; font-size: 12.5px; line-height: 1.25; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.film i { position: absolute; top: 7px; left: 9px; font-style: normal; color: var(--sand-light); font-size: 12px; font-weight: 600; z-index: 1; }
.criteria { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.criteria li { padding-left: 24px; position: relative; }
.criteria li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border: 2px solid var(--turq); transform: rotate(45deg); }
table.plan-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.plan-table th, .plan-table td { text-align: left; vertical-align: top; padding: 11px 10px; border-bottom: 1px solid var(--line); }
.plan-table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-table td.min { white-space: nowrap; font-family: var(--serif); font-weight: 600; color: var(--cobalt); }
.table-scroll { overflow-x: auto; }
.task { padding: 18px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.task-head .n { font-family: var(--serif); font-weight: 600; color: var(--sand); font-size: 20px; }
.task-head h3 { margin: 0; font-size: 18px; }
.task-head .meta { color: var(--muted); font-size: 14px; }
.task-head .btn { margin-left: auto; }
.descr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; margin-top: 10px; font-size: 15px; }
.descr b { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.descr ul, .plain { margin: 0; padding-left: 18px; }
.side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.side-panel h2 { font-size: 20px; margin-bottom: 12px; }
.side-panel .doc { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.objective { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.objective:first-of-type { border-top: 0; }
.code { font-weight: 700; color: var(--cobalt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl { display: grid; gap: 10px; font-size: 15px; }
.dl div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
.dl b { font-family: var(--serif); color: var(--cobalt); font-weight: 600; }
.terms p { margin: 0 0 10px; font-size: 15px; }
.terms b { font-weight: 600; }
.run-panel { position: sticky; top: 88px; }

/* game cards */
.game-groups { display: grid; gap: 26px; }
.game-group h3 { font-size: 17px; margin-bottom: 10px; color: var(--ink-2); }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.game-card { text-align: left; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-md); padding: 16px 16px 14px; cursor: pointer; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.game-card:hover { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.game-card .gi { grid-row: span 2; width: 40px; height: 40px; border-radius: 8px; background: var(--cobalt-soft); color: var(--cobalt); display: grid; place-items: center; }
.game-card .gi svg { width: 22px; height: 22px; }
.game-card.map .gi { background: var(--turq-soft); color: var(--turq); }
.game-card b { font-size: 16px; font-weight: 600; }
.game-card span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.games-only .games-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.games-only .game-card { padding: 22px; grid-template-columns: 48px minmax(0, 1fr); }
.games-only .game-card .gi { width: 48px; height: 48px; }
.games-only .game-card b { font-size: 18px; }
.locked-box { text-align: center; padding: 56px 20px; }

/* account */
.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 15px; }
.simple th, .simple td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.simple th { color: var(--muted); font-size: 13.5px; font-weight: 600; }

footer.site { margin-top: 56px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ---------- KSP (printable plan) ---------- */
.ksp-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.ksp-tools .muted { margin-right: auto; }
.ksp { background: #fff; color: #111; max-width: 960px; margin: 0 auto 24px; padding: 34px 38px; border: 1px solid var(--line); border-radius: 4px; font-size: 14.5px; line-height: 1.45; overflow-x: auto; overflow-wrap: anywhere; }
.ksp h1 { font-size: 21px; text-align: center; margin-bottom: 16px; }
.ksp h2 { font-size: 16.5px; margin: 20px 0 8px; }
.ksp table { width: 100%; border-collapse: collapse; }
.ksp th, .ksp td { border: 1px solid #444; padding: 6px 8px; vertical-align: top; text-align: left; }
.ksp-head th { width: 26%; background: #f1f2ef; font-weight: 600; }
.ksp-table thead th { background: #f1f2ef; font-size: 13px; }
.ksp-table td:first-child { width: 17%; }
.ksp ul { margin: 0; padding-left: 18px; }
.ksp input { border: 0; border-bottom: 1px dashed #999; width: 100%; padding: 2px 0; background: transparent; }
.ksp-task { margin-bottom: 10px; }
.ksp-task p { margin: 4px 0; }
.ksp-foot { margin-top: 18px; font-size: 12px; color: #555; }

/* =================== STAGE (board) =================== */
.stage { position: fixed; inset: 0; z-index: 100; background: var(--night); color: var(--night-ink); display: flex; flex-direction: column; font-family: var(--sans); }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--night-line); flex-wrap: wrap; }
.stage-bar .title { margin-right: auto; display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 15px; color: var(--night-muted); }
.stage-bar .title b { color: var(--night-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbtn { border: 1px solid var(--night-line); background: transparent; color: var(--night-ink); padding: 7px 12px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.sbtn svg { width: 16px; height: 16px; }
.sbtn:hover { background: var(--night-2); }
.sbtn[aria-pressed="true"] { background: var(--night-3); border-color: var(--sand-light); }
.sbtn.primary { background: var(--sand-light); color: #241907; border-color: var(--sand-light); }
.sbtn.primary:hover { background: #e3c897; }
.sbtn[disabled] { opacity: .35; cursor: default; }
.stage .lang { border-color: var(--night-line); }
.stage .lang button { color: var(--night-muted); }
.stage .lang button[aria-pressed="true"] { background: var(--night-ink); color: var(--night); }
.stage-body { flex: 1; overflow: auto; display: flex; position: relative; }
.stage-body > .slide, .stage-body > .game, .stage-body > .setup, .stage-body > .final, .stage-body > .wheel-wrap { margin: auto; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--night-line); }
.stage-foot .count { color: var(--night-muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.progress { height: 3px; background: var(--night-2); }
.progress > div { height: 100%; background: var(--sand-light); transition: width .3s; }
.credit { font-size: 12px; color: var(--night-muted); line-height: 1.35; }
.credit a { color: inherit; }

/* slides */
.slide { width: min(1240px, 100%); padding: clamp(18px, 3.2vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 2vh, 26px); animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.slide h2 { font-size: clamp(28px, 3.8vw, 54px); line-height: 1.08; margin: 0; color: #fff; max-width: 22em; }
.slide .lead { font-size: clamp(18px, 2.1vw, 28px); color: var(--night-muted); max-width: 34em; margin: 0; }
.slide .ptext { font-size: clamp(19px, 2.2vw, 30px); line-height: 1.5; max-width: 34em; margin: 0; font-family: var(--serif); font-weight: 400; }
.slide .label { color: var(--sand-light); font-size: clamp(14px, 1.3vw, 17px); font-weight: 600; }
ul.bul { list-style: none; padding: 0; margin: 0; display: grid; gap: clamp(10px, 1.6vh, 18px); }
ul.bul li { font-size: clamp(18px, 2.1vw, 29px); line-height: 1.32; padding-left: 1.2em; position: relative; }
ul.bul li::before { content: ""; position: absolute; left: .05em; top: .5em; width: .42em; height: .42em; border: 2px solid var(--sand-light); transform: rotate(45deg); }
.slide.full { width: 100%; height: 100%; padding: 0; position: relative; justify-content: flex-end; }
.s-cover { background: var(--night) center / cover no-repeat; }
.s-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(95deg, rgba(14, 26, 43, .97) 0%, rgba(14, 26, 43, .85) 38%, rgba(14, 26, 43, .25) 72%, rgba(14, 26, 43, .1) 100%); }
.s-cover .inner { position: relative; padding: clamp(24px, 5vw, 80px); max-width: 920px; }
.s-cover h2 { font-size: clamp(36px, 5.6vw, 84px); line-height: 1.02; letter-spacing: -.015em; }
.s-cover .lead { margin-top: 18px; color: #d4dde8; }
.s-cover .label { margin-bottom: 14px; display: block; }
.s-cover .credit { position: absolute; right: 18px; bottom: 12px; text-align: right; max-width: 40%; }
.media-frame { position: relative; background: var(--night-2); border-radius: 4px; overflow: hidden; }
.media-frame img { width: 100%; height: 100%; object-fit: contain; }
.s-image { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 44px); align-items: center; }
.s-image .media-frame { height: min(68vh, 640px); }
.s-image h2 { font-size: clamp(26px, 3vw, 44px); }
.s-image .cap { font-size: clamp(16px, 1.7vw, 22px); color: #d4dde8; line-height: 1.5; margin: 14px 0 0; }
.s-image .ask { margin-top: 20px; padding: 16px 18px; border-left: 3px solid var(--sand-light); background: var(--night-2); font-family: var(--serif); font-size: clamp(17px, 1.8vw, 24px); line-height: 1.4; }
.s-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3.5vw, 56px); align-items: center; }
.s-split.img-right .media-frame { order: 2; }
.s-split .media-frame { height: min(70vh, 660px); }
.s-split .media-frame img { object-fit: cover; }
.s-split h2 { font-size: clamp(26px, 3.2vw, 46px); margin-bottom: 18px; }
.s-gallery .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.s-gallery figure { margin: 0; }
.s-gallery .media-frame { height: min(42vh, 400px); }
.s-gallery .media-frame img { object-fit: cover; }
.s-gallery figcaption { margin-top: 10px; font-size: clamp(14px, 1.4vw, 18px); color: #d4dde8; line-height: 1.4; }
.slide.s-map { width: min(1500px, 100%); display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); gap: clamp(18px, 2.6vw, 36px); align-items: center; }
.s-map .map-box { background: var(--night-2); border-radius: 4px; overflow: hidden; }
.s-map .map-box svg { width: 100%; height: auto; max-height: 78vh; display: block; }
.s-map h2 { font-size: clamp(24px, 2.8vw, 40px); margin-bottom: 14px; }
.s-map .cap { font-size: clamp(16px, 1.6vw, 21px); color: #d4dde8; line-height: 1.5; margin: 0; }
.s-figure { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 64px); align-items: center; }
.s-figure .media-frame { height: min(70vh, 640px); }
.s-figure .media-frame img { object-fit: cover; object-position: top; }
.s-figure .no-photo { height: min(56vh, 520px); display: grid; place-items: center; border: 1px solid var(--night-line); border-radius: 4px; color: var(--night-line); }
.s-figure .no-photo svg { width: 45%; height: auto; }
.s-figure .lead { margin: 10px 0 22px; }
.s-quote { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 60px); align-items: center; }
.s-quote .media-frame { width: clamp(180px, 22vw, 320px); aspect-ratio: 3 / 4; }
.s-quote .media-frame img { object-fit: cover; object-position: top; }
.bq { margin: 0; max-width: 30em; }
.bq p { font-family: var(--serif); font-size: clamp(24px, 3.2vw, 46px); line-height: 1.3; margin: 0 0 18px; }
.bq p::before { content: "«"; color: var(--sand-light); }
.bq p::after { content: "»"; color: var(--sand-light); }
.bq cite { font-style: normal; color: var(--sand-light); font-weight: 600; font-size: clamp(16px, 1.6vw, 21px); }
.tl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin-top: 10px; position: relative; }
.tl::before { content: ""; position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--night-line); }
.tl-item { padding: 0 14px 0 0; position: relative; }
.tl-item b { display: block; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 38px); font-weight: 600; color: var(--sand-light); font-variant-numeric: tabular-nums; line-height: 1; height: 34px; }
.tl-item::before { content: ""; position: absolute; left: 0; top: 29px; width: 12px; height: 12px; background: var(--night); border: 2px solid var(--sand-light); transform: rotate(45deg); }
.tl-item span { display: block; margin-top: 26px; font-size: clamp(15px, 1.6vw, 21px); line-height: 1.4; color: #dfe6ee; }
.terms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--night-line); }
.term-card { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--night-line); }
.term-card b { display: block; font-family: var(--serif); color: var(--sand-light); font-size: clamp(19px, 2vw, 27px); font-weight: 600; margin-bottom: 6px; }
.term-card span { font-size: clamp(15px, 1.6vw, 20px); color: #dfe6ee; line-height: 1.45; }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-top: 2px solid var(--sand-light); }
.compare > div { padding: 22px 26px 6px 0; }
.compare > div + div { padding-left: 26px; border-left: 1px solid var(--night-line); }
.compare h3 { font-size: clamp(20px, 2.2vw, 30px); color: #fff; margin-bottom: 14px; }
.compare ul { margin: 0; padding-left: 1.1em; display: grid; gap: 10px; font-size: clamp(16px, 1.8vw, 23px); line-height: 1.4; }
.q-box { border-left: 3px solid var(--sand-light); padding: 6px 0 6px clamp(16px, 2.4vw, 32px); }
.q-box .ptext { font-size: clamp(24px, 3vw, 42px); line-height: 1.3; }
.hint-box { margin-top: 18px; color: var(--sand-light); font-size: clamp(16px, 1.7vw, 22px); }
.notes { position: absolute; left: 18px; right: 18px; bottom: 14px; background: #f7f3e8; color: #2b2414; border-radius: var(--r-md); padding: 14px 16px; font-size: 15px; line-height: 1.5; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); max-height: 34%; overflow: auto; z-index: 5; }
.notes b { display: block; font-size: 13px; margin-bottom: 2px; color: #7a5a24; }
.credits-list { columns: 2; column-gap: 40px; font-size: clamp(13px, 1.2vw, 15px); color: #c8d3df; line-height: 1.45; }
.credits-list p { break-inside: avoid; margin: 0 0 12px; }
.credits-list b { color: #fff; font-weight: 600; }

/* =================== GAMES =================== */
.game { width: min(1160px, 100%); padding: clamp(16px, 2.6vw, 40px); display: grid; gap: clamp(14px, 2vh, 24px); }
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--night-muted); font-size: 15px; }
.g-q { font-family: var(--serif); font-size: clamp(24px, 3vw, 42px); font-weight: 600; line-height: 1.25; color: #fff; }
.opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(10px, 1.4vw, 16px); }
.opt { text-align: left; border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-ink); border-radius: var(--r-md); padding: clamp(14px, 1.8vw, 22px); font-size: clamp(17px, 1.9vw, 24px); cursor: pointer; display: flex; gap: 16px; align-items: center; min-height: 74px; line-height: 1.3; }
.opt:hover:not([disabled]) { border-color: var(--sand-light); }
.opt .lt { flex: none; width: 1.9em; height: 1.9em; border-radius: 6px; border: 1px solid var(--night-line); display: grid; place-items: center; font-weight: 700; color: var(--sand-light); font-size: .85em; }
.opt.ok { background: #1d4a35; border-color: #57b885; }
.opt.bad { background: #4a2328; border-color: #c46a6e; }
.opt[disabled] { cursor: default; }
.explain { border-left: 3px solid var(--sand-light); background: var(--night-2); padding: 14px 18px; font-size: clamp(16px, 1.7vw, 21px); line-height: 1.5; }
.explain b { color: var(--sand-light); }
.scoreboard { display: flex; gap: 8px; flex-wrap: wrap; }
.team-chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--night-line); border-radius: var(--r-sm); padding: 7px 12px; font-weight: 600; color: var(--night-ink); }
.team-chip.active { border-color: var(--sand-light); background: var(--night-2); }
.team-chip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; transform: rotate(45deg); }
.team-chip b { font-family: var(--serif); font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; }
.timer-ring { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; border: 1px solid var(--night-line); border-radius: var(--r-sm); padding: 5px 12px; min-width: 64px; text-align: center; }
.timer-ring.low { background: var(--madder); border-color: var(--madder); color: #fff; }
.setup { display: grid; gap: 22px; text-align: center; justify-items: center; padding: 30px; max-width: 760px; }
.setup .gicon { width: 56px; height: 56px; color: var(--sand-light); }
.setup h2 { font-size: clamp(30px, 4vw, 52px); margin: 0; }
.setup p { color: var(--night-muted); margin: 0; font-size: 18px; }
.setup .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.setup .row span { color: var(--night-muted); margin-right: 6px; }
.big-btn { font-size: clamp(17px, 1.8vw, 22px); padding: 13px 30px; border-radius: var(--r-sm); border: 0; background: var(--sand-light); color: #241907; font-weight: 700; cursor: pointer; }
.big-btn:hover { background: #e3c897; }
.final { text-align: center; display: grid; gap: 18px; justify-items: center; padding: 30px; }
.final h2 { font-size: clamp(32px, 4.6vw, 64px); margin: 0; }
.final .gicon { width: 64px; height: 64px; color: var(--sand-light); }
.final .scoreboard { justify-content: center; }
.tf-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tf-btns button { border: 1px solid var(--night-line); background: var(--night-2); color: #fff; border-radius: var(--r-md); padding: clamp(18px, 2.6vw, 30px); font-size: clamp(22px, 2.6vw, 34px); font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 14px; }
.tf-btns button svg { width: 1.1em; height: 1.1em; }
.tf-true svg { color: #57b885; } .tf-false svg { color: #d98286; }
.tf-btns button:hover:not([disabled]) { border-color: var(--sand-light); }
.tf-btns button[disabled] { opacity: .4; cursor: default; }
.tf-btns button.picked { opacity: 1; border-color: #fff; }
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 2vw, 32px); }
.match .col { display: grid; gap: 10px; align-content: start; }
.mcard { border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-ink); border-radius: var(--r-md); padding: 14px 16px; font-size: clamp(15px, 1.6vw, 20px); cursor: pointer; text-align: left; min-height: 58px; line-height: 1.35; }
.mcard:hover:not([disabled]) { border-color: var(--sand-light); }
.mcard.sel { border-color: var(--sand-light); background: var(--night-3); }
.mcard.done { background: #1d4a35; border-color: #57b885; cursor: default; }
.mcard.err { background: #4a2328; border-color: #c46a6e; }
.order-list { display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; border: 1px solid var(--night-line); background: var(--night-2); border-radius: var(--r-md); padding: 12px 14px; font-size: clamp(16px, 1.8vw, 22px); cursor: pointer; }
.order-item.sel { border-color: var(--sand-light); }
.order-item .n { font-family: var(--serif); font-weight: 600; color: var(--sand-light); width: 1.6em; text-align: center; }
.order-item .yr { font-family: var(--serif); font-weight: 600; color: var(--sand-light); min-width: 5em; text-align: right; }
.order-item.ok { background: #1d4a35; border-color: #57b885; } .order-item.bad { background: #4a2328; border-color: #c46a6e; }
.arrows { display: flex; gap: 6px; }
.arrows button { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--night-line); background: transparent; color: #fff; cursor: pointer; font-size: 17px; }
.fb-text { font-family: var(--serif); font-size: clamp(22px, 2.8vw, 38px); line-height: 1.5; }
.fb-gap { display: inline-block; min-width: 5em; border-bottom: 3px solid var(--sand-light); text-align: center; color: var(--sand-light); padding: 0 .3em; }
.fb-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-opts button { border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-ink); border-radius: var(--r-md); padding: 12px 22px; font-size: clamp(17px, 1.9vw, 25px); cursor: pointer; font-weight: 600; }
.fb-opts button.ok { background: #1d4a35; border-color: #57b885; } .fb-opts button.bad { background: #4a2328; border-color: #c46a6e; }
.jboard { display: grid; gap: 8px; }
.jboard .jcat { padding: 12px; text-align: center; font-family: var(--serif); font-weight: 600; font-size: clamp(14px, 1.5vw, 19px); display: grid; place-items: center; min-height: 64px; border-bottom: 2px solid var(--sand-light); }
.jcell { border: 1px solid var(--night-line); background: var(--cobalt); color: var(--sand-light); border-radius: var(--r-sm); font-family: var(--serif); font-size: clamp(24px, 3vw, 42px); font-weight: 600; cursor: pointer; min-height: clamp(64px, 11vh, 108px); }
.jcell:hover:not([disabled]) { background: #2d51a8; }
.jcell[disabled] { background: transparent; color: transparent; cursor: default; }
.jmodal { position: absolute; inset: 0; background: rgba(10, 18, 30, .97); display: grid; place-items: center; padding: 24px; z-index: 5; }
.jmodal .inner { width: min(1000px, 100%); display: grid; gap: 22px; text-align: center; justify-items: center; }
.jmodal .pts { color: var(--sand-light); font-weight: 600; font-size: 18px; }
.jmodal .ans { font-family: var(--serif); font-size: clamp(22px, 2.8vw, 36px); color: #8fdcb2; }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tile { width: clamp(44px, 5.6vw, 68px); height: clamp(52px, 6.6vw, 78px); border-radius: var(--r-sm); border: 1px solid var(--night-line); background: var(--night-2); color: #fff; font-family: var(--serif); font-size: clamp(24px, 3.2vw, 40px); font-weight: 600; cursor: pointer; }
.tile[disabled] { opacity: .2; cursor: default; }
.answer-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: clamp(56px, 7vw, 82px); }
.slot { width: clamp(44px, 5.6vw, 68px); height: clamp(52px, 6.6vw, 78px); border-bottom: 3px solid var(--night-line); display: grid; place-items: center; font-family: var(--serif); font-size: clamp(24px, 3.2vw, 40px); font-weight: 600; color: var(--sand-light); }
.answer-row.ok .slot { color: #8fdcb2; border-color: #57b885; } .answer-row.bad .slot { color: #f0a3a6; border-color: #c46a6e; }
.wheel-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; width: min(1200px, 100%); padding: clamp(16px, 2.6vw, 40px); }
.wheel-box { position: relative; width: clamp(240px, 32vw, 440px); aspect-ratio: 1; }
.wheel-box svg { width: 100%; height: 100%; transition: transform 4.2s cubic-bezier(.17, .67, .12, 1); }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 28px solid var(--sand-light); }
.timer-big { font-family: var(--serif); font-size: clamp(80px, 18vw, 240px); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--sand-light); text-align: center; line-height: 1; }

/* map games */
.mapgame { display: grid; grid-template-columns: minmax(0, 2.8fr) minmax(300px, 1fr); gap: clamp(14px, 2vw, 28px); align-items: start; width: min(1360px, 100%); padding: clamp(12px, 2vw, 28px); }
.mapgame .map-box { background: var(--night-2); border-radius: 4px; overflow: hidden; }
.mapgame .map-box svg { width: 100%; height: auto; max-height: calc(100vh - 170px); display: block; }
.mapgame .panel { display: grid; gap: 16px; align-content: start; }
.mapgame .g-q { font-size: clamp(20px, 2.2vw, 30px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-ink); border-radius: 999px; padding: 8px 14px; font-size: clamp(14px, 1.4vw, 17px); cursor: pointer; font-weight: 600; }
.chip.sel { border-color: var(--sand-light); background: var(--night-3); }
.chip.done { opacity: .35; cursor: default; text-decoration: line-through; }
.hmap .hm-pt { cursor: default; }
.mapgame .hmap .hm-pt { cursor: pointer; }
.hmap .hm-pt.found .hm-dot, .hmap .hm-pt.found circle:not(.hm-hit):not(.hm-ring), .hmap .hm-pt.found rect { fill: #57b885; }
.hmap .hm-pt.miss circle:not(.hm-hit), .hmap .hm-pt.miss rect { fill: #d98286; }
.hmap .hm-pt.pulse circle:not(.hm-hit) { animation: pulse 1s ease 2; }
@keyframes pulse { 50% { r: 12; } }
.hmap .hm-area.found path { stroke: #57b885; }
.mapgame .hmap .hm-area path { cursor: pointer; }

/* map SVG styling (dark theme default) */
.hmap { font-family: var(--map-font, var(--sans)); }
.hm-sea { fill: var(--map-sea, #0a1f33); }
.hm-land { fill: var(--map-land, #1f3047); }
.hm-kaz { fill: var(--map-kaz, #2a3f5c); }
.hm-water { fill: var(--map-lake, #0b2236); stroke: var(--map-shore, #2d5b7a); stroke-width: .8; }
.hm-river { fill: none; stroke: var(--map-river, #2f6b8c); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.hm-border { fill: none; stroke: var(--map-border, #3a5070); stroke-width: .9; stroke-dasharray: 4 3; }
.hm-phys { fill: var(--map-phys, #5f8fb0); font-size: 15px; font-style: italic; text-anchor: middle; font-family: var(--serif); }
.hm-riverlabel { font-size: 12.5px; }
.hm-free-label { fill: var(--map-free, #9fb0c3); font-size: 14px; font-style: italic; text-anchor: middle; font-family: var(--serif); }
.hm-area path { stroke: var(--map-area, #d9bd8c); stroke-width: 2; stroke-dasharray: 7 5; fill-opacity: 1; }
.hm-hatch-bg { fill: var(--map-hatch-bg, rgba(217, 189, 140, .1)); }
.hm-hatch { stroke: var(--map-hatch, rgba(217, 189, 140, .32)); stroke-width: 2; }
.hm-influence path { stroke: #7fb7c9; }
.hm-area-label { fill: var(--map-area-label, #e9d6b1); font-family: var(--serif); font-size: 19px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--map-halo, #0e1a2b); stroke-width: 4px; }
.hm-route path { fill: none; stroke: var(--map-route, #e0675c); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hm-migration path, .hm-move path { stroke: var(--map-route2, #7fc8c9); stroke-dasharray: 8 6; }
.hm-trade path { stroke: var(--map-area, #d9bd8c); stroke-dasharray: 2 6; }
.hm-arrowhead { fill: var(--map-route, #e0675c); }
.hm-route-label { fill: var(--map-route-label, #f2b2aa); font-size: 14px; font-weight: 600; paint-order: stroke; stroke: var(--map-halo, #0e1a2b); stroke-width: 4px; }
.hm-pt circle:not(.hm-hit):not(.hm-ring), .hm-pt rect, .hm-dot { fill: var(--map-dot, #f4efe4); stroke: var(--map-halo, #0e1a2b); stroke-width: 1.5; }
.hm-capital circle:not(.hm-hit):not(.hm-ring) { fill: var(--map-capital, #d9bd8c); }
.hm-ring { fill: none; stroke: var(--map-capital, #d9bd8c); stroke-width: 2; }
.hm-x { stroke: var(--map-route, #e0675c); stroke-width: 3; stroke-linecap: round; fill: none; }
.hm-hit { fill: transparent; }
.hm-label { fill: var(--map-label, #fff); font-size: 16px; font-weight: 600; paint-order: stroke; stroke: var(--map-halo, #0e1a2b); stroke-width: 4px; stroke-linejoin: round; }
.hm-capital .hm-label { fill: var(--map-capital-label, #f1dcae); font-size: 17px; }
.hm-legend text { fill: var(--map-legend, #c2cfdc); font-size: 12.5px; }
.hm-legend { paint-order: stroke; }
.hm-route-key { stroke: var(--map-route, #e0675c); stroke-width: 3; }
.hm-border-key { stroke: var(--map-border, #3a5070); stroke-width: 1.5; stroke-dasharray: 4 3; }
.hm-area-key { stroke: var(--map-area, #d9bd8c); stroke-dasharray: 3 2; }
.hm-credit { fill: #4f6680; font-size: 11px; text-anchor: end; }

/* detective */
.detective { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 44px); align-items: start; }
.clues { display: grid; gap: 10px; counter-reset: c; }
.clue { border: 1px solid var(--night-line); border-radius: var(--r-md); padding: 14px 18px 14px 56px; position: relative; font-size: clamp(17px, 1.9vw, 24px); line-height: 1.4; background: var(--night-2); min-height: 56px; }
.clue::before { counter-increment: c; content: counter(c); position: absolute; left: 16px; top: 13px; font-family: var(--serif); font-weight: 600; color: var(--sand-light); font-size: 1.1em; }
.clue.locked { color: var(--night-muted); background: transparent; border-style: dashed; font-size: 15px; display: flex; align-items: center; }
.pts-big { font-family: var(--serif); font-size: clamp(40px, 5vw, 68px); color: var(--sand-light); line-height: 1; }

/* sort */
.sort-cols { display: grid; gap: 14px; }
.sort-col { border: 1px solid var(--night-line); border-radius: var(--r-md); min-height: 180px; padding: 12px; display: grid; gap: 8px; align-content: start; cursor: pointer; }
.sort-col:hover { border-color: var(--sand-light); }
.sort-col h3 { font-size: clamp(17px, 1.8vw, 23px); color: var(--sand-light); margin: 2px 4px 6px; }
.scard { border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-ink); border-radius: var(--r-sm); padding: 10px 14px; font-size: clamp(15px, 1.6vw, 19px); text-align: left; cursor: pointer; line-height: 1.35; }
.scard.sel { border-color: var(--sand-light); background: var(--night-3); }
.scard.ok { background: #1d4a35; border-color: #57b885; }
.scard.bad { background: #4a2328; border-color: #c46a6e; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }

/* photo quiz */
.photo-q { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; }
.photo-q .media-frame { height: min(66vh, 600px); }
.photo-q .opts { grid-template-columns: 1fr; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* ---------- prices, checkout, buying a lesson ---------- */
.plan { position: relative; }
.plan-badge { position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--cobalt); color: #fff; }
.price-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.price-notes p { display: flex; gap: 10px; margin: 0; font-size: 14.5px; color: var(--ink-2); }
.price-notes svg { width: 20px; height: 20px; flex: none; color: var(--turq); margin-top: 2px; }
.subject-opt .tag { white-space: nowrap; }
.grade-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.grade-pick button { border: 1px solid var(--line-strong); background: #fff; border-radius: var(--r-md); padding: 10px 4px; cursor: pointer; display: grid; gap: 3px; color: var(--ink); font: inherit; }
.grade-pick .num { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.grade-pick small { font-size: 12px; color: var(--muted); }
.grade-pick button[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.grade-pick button[aria-pressed="true"] small { color: #d6def2; }
.grade-pick button:disabled { opacity: .45; cursor: not-allowed; }
.summary-row.co-credit b { color: var(--ok); white-space: nowrap; }
.summary-row.co-credit small { display: block; font-size: 12.5px; color: var(--muted); }
.upsell { margin: 22px 0 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--sand-soft); color: #6b4f1f; font-size: 14.5px; }
.grade-buy { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.grade-buy > div:first-child { display: grid; gap: 2px; }
.grade-buy > div:first-child span { color: var(--muted); font-size: 14.5px; }
.gb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag.lock { display: inline-flex; align-items: center; gap: 5px; }
.tag.lock svg { width: 13px; height: 13px; }
.buy-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 32px; align-items: start; margin: 28px 0 40px; }
.buy-wrap h2 { margin-top: 0; }
.buy-wrap h2 .h-ic { width: 24px; height: 24px; vertical-align: -3px; color: var(--sand); }
.inside { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; color: var(--ink-2); }
.inside li { padding-left: 22px; position: relative; }
.inside li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; background: var(--turq); transform: rotate(45deg); }
.buy-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.buy-opt { display: grid; gap: 4px; padding: 20px; text-decoration: none; color: var(--ink); align-content: start; }
.buy-opt + .buy-opt { border-left: 1px solid var(--line); }
.buy-opt:hover { background: var(--surface-2); }
.buy-opt.featured { background: var(--cobalt-soft); }
.buy-opt .p { font-family: var(--serif); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.buy-opt small { color: var(--muted); font-size: 13px; }
.acc-grid > .wide { grid-column: 1 / -1; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .price-notes, .buy-wrap { grid-template-columns: minmax(0, 1fr); }
  .buy-opts { grid-template-columns: minmax(0, 1fr); }
  .buy-opt + .buy-opt { border-left: 0; border-top: 1px solid var(--line); }
  .hero, .lesson-grid, .checkout, .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .run-panel { position: static; }
  .anatomy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .anatomy > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line); }
  .s-image, .s-split, .s-map, .s-figure, .detective, .photo-q, .mapgame { grid-template-columns: minmax(0, 1fr); }
  .s-split.img-right .media-frame { order: 0; }
  .filmstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar .container { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .nav { margin-left: 0; width: 100%; }
  .anatomy { grid-template-columns: minmax(0, 1fr); }
  .anatomy > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .opts, .tf-btns, .match, .compare { grid-template-columns: minmax(0, 1fr); }
  .compare > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--night-line); }
  .topic { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .topic .meta { text-align: left; }
  .grade-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ruler { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ruler > :nth-child(5) { border-left: 0; }
  .ruler > :nth-child(n+5) { border-top: 1px solid var(--line); }
  .tl { grid-auto-flow: row; }
  .tl::before { display: none; }
  .wheel-wrap, .s-quote { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .order-item { grid-template-columns: auto minmax(0, 1fr); }
  .order-item .yr { grid-column: 2; text-align: left; }
  .order-item .arrows { grid-column: 1 / -1; justify-content: flex-end; }
  .lesson-cover .inner { padding: 24px 20px; }
  .credits-list { columns: 1; }
  .ksp { padding: 16px; font-size: 13.5px; }
}

/* ---------- print (KSP) ---------- */
@media print {
  .topbar, footer.site, .no-print { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .container { max-width: none; padding: 0; }
  .ksp { border: 0; padding: 0; max-width: none; font-size: 11pt; }
  .ksp input { border: 0; }
  .ksp tr { break-inside: avoid; }
  @page { size: A4; margin: 14mm; }
}

.img-info { margin: 8px 0 32px; font-size: 13px; color: var(--muted, #667); }
.img-info summary { cursor: pointer; font-size: 14px; }
.img-info ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.img-info a { color: inherit; }

/* sale state: a grade / the subject goes on sale when enough lessons are ready */
.plan-sale { margin: 4px 0 14px; font-size: 14px; line-height: 1.45; color: var(--turq); font-weight: 600; }
.plan-sale.soon { color: var(--muted); font-weight: 400; }
.plan .btn[aria-disabled="true"] { opacity: .55; cursor: default; pointer-events: none; }
.subject-opt.off { opacity: .6; cursor: default; }
.tag.soon { background: transparent; border: 1px dashed currentColor; }
.grade-buy.wait { background: var(--surface-2); border-style: dashed; }
.grade-buy.wait span { max-width: 820px; }
.buy-opts.one { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: center; }
.buy-soon { font-size: 14.5px; line-height: 1.5; margin: 0; padding: 20px; border-left: 1px solid var(--line); }
@media (max-width: 980px) { .buy-opts.one { grid-template-columns: minmax(0, 1fr); } .buy-soon { border-left: 0; border-top: 1px solid var(--line); } }
.hm-legend-bg { fill: var(--map-halo, #0e1a2b); opacity: .82; stroke: none; }

/* ---------- Ұстазхана landing (2026-12) ---------- */
.section > h2 { font-size: clamp(30px, 4.2vw, 54px); font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-bottom: 14px; }
.uh-hero { padding: clamp(44px, 7vw, 96px) 0 8px; }
.uh-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 7px 14px 7px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.uh-kicker i { width: 8px; height: 8px; border-radius: 50%; background: #22a565; box-shadow: 0 0 0 0 rgba(34, 165, 101, .45); animation: uhpulse 2.2s ease-out infinite; }
@keyframes uhpulse { 70% { box-shadow: 0 0 0 9px rgba(34, 165, 101, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 165, 101, 0); } }
.uh-title { font-size: clamp(46px, 9vw, 128px); line-height: .94; letter-spacing: -.055em; font-weight: 800; margin: 26px 0 0; }
.uh-title .light { background: linear-gradient(var(--sand-light), var(--sand-light)) no-repeat 0 82% / 0 34%; animation: uhlight .9s .35s cubic-bezier(.6, 0, .2, 1) forwards; padding: 0 .04em; }
@keyframes uhlight { to { background-size: 100% 34%; } }
.uh-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-top: 30px; }
.uh-lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 31em; margin: 0; }
.uh-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.uh-stage { margin-top: clamp(36px, 5vw, 64px); perspective: 1800px; }
.uh-screen { position: relative; aspect-ratio: 16 / 9; border-radius: clamp(14px, 2vw, 28px); overflow: hidden; background: var(--night); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); box-shadow: 0 60px 120px -50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .06); }
.uh-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; display: flex; align-items: flex-end; color: #fff; text-decoration: none; }
.uh-slide.on { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.uh-slide .img { position: absolute; inset: 0; background: var(--night-2) center / cover no-repeat; transform: scale(1.12); transition: transform 7s linear; }
.uh-slide.on .img { transform: scale(1); }
.uh-slide .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, .2) 52%, rgba(0, 0, 0, .86) 100%); }
.uh-slide .txt { position: relative; z-index: 2; padding: clamp(20px, 4vw, 56px); max-width: min(78%, 900px); display: flex; flex-direction: column; gap: 10px; }
.uh-slide .par { font-size: clamp(13px, 1.2vw, 16px); font-weight: 600; color: var(--sand-light); letter-spacing: .02em; }
.uh-slide .ttl { font-size: clamp(22px, 3.8vw, 56px); font-weight: 800; line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.uh-slide .cnt { font-size: clamp(13px, 1.2vw, 16px); color: rgba(255, 255, 255, .82); }
.uh-slide .go { display: inline-flex; align-self: flex-start; margin-top: 6px; padding: 10px 18px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; transform: translateY(8px); opacity: 0; transition: .35s; }
.uh-screen:hover .uh-slide.on .go, .uh-slide.on:focus-visible .go { transform: none; opacity: 1; }
.uh-big { position: absolute; right: clamp(16px, 3vw, 44px); bottom: clamp(4px, 1vw, 14px); z-index: 1; font-size: clamp(90px, 20vw, 300px); font-weight: 800; line-height: .8; letter-spacing: -.07em; color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .45); pointer-events: none; }
.uh-bars { position: absolute; top: 10px; left: 16px; right: 16px; z-index: 3; display: flex; gap: 6px; }
.uh-bars button { flex: 1; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; position: relative; }
.uh-bars button::before, .uh-bars button::after { content: ""; position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; }
.uh-bars button::before { right: 0; background: rgba(255, 255, 255, .32); }
.uh-bars button::after { width: 0; background: #fff; }
.uh-bars button.done::after { width: 100%; }
.uh-bars button.on::after { animation: uhbar 6s linear forwards; }
@keyframes uhbar { to { width: 100%; } }
.uh-under { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--muted); }

.uh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(48px, 7vw, 96px); border-top: 1px solid var(--ink); }
.uh-stats > div { padding: 22px 20px 0 0; display: flex; flex-direction: column; gap: 6px; }
.uh-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.uh-stats b { font-size: clamp(40px, 5.6vw, 76px); font-weight: 800; line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.uh-stats span { color: var(--ink-2); font-size: 15px; }

.uh-marquee { width: 100vw; margin: clamp(48px, 7vw, 96px) 0 0 calc(50% - 50vw); padding: 26px 0; border-block: 1px solid var(--line); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.uh-track { display: flex; gap: 44px; width: max-content; animation: uhm 120s linear infinite; }
.uh-marquee:hover .uh-track { animation-play-state: paused; }
.uh-track span { font-size: clamp(24px, 3vw, 40px); font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.uh-track span:nth-child(even) { color: transparent; -webkit-text-stroke: 1.3px var(--ink); }
@keyframes uhm { to { transform: translateX(-50%); } }

.uh-inside { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 8px; }
.uh-inside > div { padding: 26px 24px 26px 0; border-top: 1px solid var(--ink); position: relative; }
.uh-inside > div + div { padding-left: 24px; }
.uh-inside .n { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 30px; font-variant-numeric: tabular-nums; }
.uh-inside h3 { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.uh-inside p { color: var(--ink-2); font-size: 15.5px; margin: 0; }
.uh-inside > div::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--sand-light); transition: width .5s ease; }
.uh-inside > div + div::before { left: 24px; }
.uh-inside > div:hover::before { width: calc(100% - 24px); }

@media (max-width: 980px) {
  .uh-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uh-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .uh-stats > div:nth-child(n + 3) { padding-top: 28px; }
  .uh-inside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uh-inside > div:nth-child(3) { padding-left: 0; }
  .uh-inside > div:nth-child(3)::before { left: 0; }
}
@media (max-width: 600px) {
  .uh-slide .txt { max-width: 100%; }
  .uh-inside { grid-template-columns: minmax(0, 1fr); }
  .uh-inside > div + div { padding-left: 0; }
  .uh-inside > div + div::before { left: 0; }
  .uh-actions, .uh-actions .btn { width: 100%; }
}
@media (max-width: 600px) { .uh-screen { aspect-ratio: 4 / 5; } .uh-big { font-size: 140px; } }
@media (pointer: coarse) { .uh-under span:last-child { display: none; } }

/* ---------- Ұстазхана lesson page (2026-12): header, sticky tabs, flow with clock ---------- */
.lx-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 34px 0 30px; }
.lx-head > * { min-width: 0; }
.lx-kick { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.lx-kick span { font-size: 13.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.lx-kick .par { background: var(--sand-light); color: #2b1f0b; }
.lx-head h1 { font-size: clamp(30px, 3.6vw, 50px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin-bottom: 14px; text-wrap: balance; }
.lx-src { color: var(--muted); font-size: 15px; max-width: 46em; }
.lx-acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 26px; }
.lx-nums { display: flex; gap: 34px; flex-wrap: wrap; }
.lx-nums div { display: flex; flex-direction: column; }
.lx-nums b { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.lx-nums span { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.lx-cover { margin: 0; }
.lx-cover button { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: var(--r-lg); background: var(--night) center / cover no-repeat; cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45); transition: transform .35s ease; }
.lx-cover button:hover { transform: translateY(-3px); }
.lx-cover button span { position: absolute; right: 16px; bottom: 16px; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); display: grid; place-items: center; transition: transform .25s ease; }
.lx-cover button:hover span { transform: scale(1.08); }
.lx-cover button span svg { width: 24px; height: 24px; }
.lx-cover figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

.lx-tabs { position: sticky; top: var(--tb, 68px); z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 10px 0; margin-bottom: 26px; background: rgba(250, 250, 247, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lx-tablist { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.lx-tablist::-webkit-scrollbar { display: none; }
.lx-tablist button { flex: none; border: 0; background: none; padding: 9px 15px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.lx-tablist button:hover { color: var(--ink); background: var(--surface-2); }
.lx-tablist button[aria-selected="true"] { background: var(--ink); color: #fff; }
.lx-tablist small { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.lx-tablist button[aria-selected="true"] small { background: rgba(255, 255, 255, .18); color: #fff; }
.lx-clock { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lx-clock-t { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lx-clock-t b { font-size: 20px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.lx-clock-now { font-size: 14px; font-weight: 600; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-clock.on .lx-clock-t b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; margin-right: 8px; vertical-align: middle; animation: lxpulse 1.6s ease-in-out infinite; }
@keyframes lxpulse { 50% { opacity: .3; } }
.lx-clock .lx-x { padding: 7px; }
.lx-clock .lx-x svg { width: 16px; height: 16px; }

.lx-pane { min-height: 50vh; padding-bottom: 40px; }
.lx-lead { color: var(--muted); margin-bottom: 18px; max-width: 60em; }
.lx-flow { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.lx-flow > * { min-width: 0; }
.lx-bar { display: flex; gap: 4px; height: 8px; margin-bottom: 22px; }
.lx-bar span { position: relative; border-radius: 99px; background: var(--line); overflow: hidden; }
.lx-bar i { position: absolute; inset: 0; background: var(--sand-light); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .9s linear; }
.lx-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lx-stage { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .25s, box-shadow .25s, opacity .25s; }
.lx-stage.now { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sand-light); }
.lx-stage.past { opacity: .55; }
.lx-time b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lx-time small { color: var(--muted); font-size: 13px; }
.lx-body h3 { font-size: 19px; margin-bottom: 8px; }
.lx-body p { margin: 0 0 8px; font-size: 15.5px; color: var(--ink-2); }
.lx-body .lx-st { font-size: 14.5px; color: var(--muted); }
.lx-body .lx-st b { color: var(--ink-2); font-weight: 600; }
.lx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); line-height: 1.25; text-align: left; }
button.lx-chip { cursor: pointer; transition: filter .15s; }
button.lx-chip:hover { filter: brightness(.94); }
.lx-chip svg { width: 14px; height: 14px; flex: none; }
.lx-chip.c-slide { background: var(--cobalt-soft); border-color: transparent; color: var(--cobalt-dark); }
.lx-chip.c-game { background: var(--sand-soft); border-color: transparent; color: #6b4d0f; }
.lx-chip.c-task { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.lx-side { position: sticky; top: calc(var(--tb, 68px) + 80px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 22px; }
.lx-side section { padding: 16px 0; border-top: 1px solid var(--line); }
.lx-side section:first-child { border-top: 0; }
.lx-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.lx-side p { font-size: 15px; margin: 0; }
.lx-side .criteria { margin: 0; font-size: 14.5px; }
.lx-side .objective { font-size: 14px; padding: 8px 0; }

.lx-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lx-slide { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface) center / cover no-repeat; cursor: pointer; overflow: hidden; padding: 0; text-align: left; transition: transform .2s ease, box-shadow .2s ease; }
.lx-slide:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .45); }
.lx-slide.img { border: 0; }
.lx-slide.img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 30%, rgba(0, 0, 0, .8)); }
.lx-slide i { position: absolute; top: 9px; left: 11px; font-style: normal; font-weight: 800; font-size: 13px; color: var(--muted); z-index: 1; }
.lx-slide em { position: absolute; top: 8px; right: 9px; z-index: 1; font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sand-light); color: #2b1f0b; }
.lx-slide span { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lx-slide.img i, .lx-slide.img span { color: #fff; }

.lx-used { font-size: 12.5px; font-weight: 600; color: #6b4d0f; background: var(--sand-soft); padding: 3px 9px; border-radius: 999px; align-self: flex-start; }

.lx-tasks { display: grid; gap: 14px; max-width: 880px; }
.lx-task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; transition: box-shadow .3s; scroll-margin-top: 160px; }
.lx-task.flash { box-shadow: 0 0 0 3px var(--sand-light); }
.lx-task.soft { background: var(--surface-2); border-color: transparent; }
.lx-task.soft h3 { font-size: 17px; }
.lx-task > p { margin: 10px 0 0; }
.lx-task-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.lx-task-head .n { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; }
.lx-task-head h3 { margin: 0 0 2px; font-size: 19px; }
.lx-task-head .meta { color: var(--muted); font-size: 14px; }

.lx-ref { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lx-ref section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; min-width: 0; }
.lx-ref h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.lx-terms { margin: 0; }
.lx-terms dt { font-weight: 700; font-size: 15px; }
.lx-terms dd { margin: 2px 0 12px; font-size: 14.5px; color: var(--ink-2); }
.lx-dates { list-style: none; margin: 0 0 0 5px; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.lx-dates li { position: relative; padding: 0 0 14px; font-size: 14.5px; }
.lx-dates li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--sand-light); border: 2px solid var(--surface); }
.lx-dates b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.lx-dates span { color: var(--ink-2); }
.lx-doc { font-size: 13.5px; color: var(--muted); margin-top: 22px; }

@media (max-width: 980px) {
  .lx-head { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 22px; }
  .lx-cover { order: -1; }
  .lx-cover button { aspect-ratio: 16 / 9; }
  .lx-flow, .lx-ref { grid-template-columns: minmax(0, 1fr); }
  .lx-side { position: static; order: -1; }
}
@media (max-width: 640px) {
  .lx-stage { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px; }
  .lx-time b { display: inline; font-size: 17px; margin-right: 4px; }
  .lx-nums { gap: 22px; }
  .lx-nums b { font-size: 28px; }
  .lx-acts .btn { flex: 1 1 auto; }
  .lx-task-head { grid-template-columns: auto minmax(0, 1fr); }
  .lx-task-head .btn { grid-column: 1 / -1; justify-self: start; }
  .lx-slides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lx-clock-now { max-width: 170px; }
}
.lx-slide:not(.img) { background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%); }
.lx-slide.t-map:not(.img) { background: linear-gradient(160deg, #fff 0%, var(--cobalt-soft) 100%); }
.lx-slide.t-quiz:not(.img), .lx-slide.t-question:not(.img) { background: linear-gradient(160deg, #fff 0%, var(--sand-soft) 100%); }
.lx-slide:not(.img) span { font-size: 15px; -webkit-line-clamp: 4; }

/* ---------- ҚМЖ / КСП: my plans list and the plan editor (2026-12) ---------- */
.pl-new { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-search { width: 100%; max-width: 420px; margin: 8px 0 18px; padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; padding-bottom: 40px; }
.pl-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .2s, box-shadow .2s, transform .2s; }
.pl-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 34px -24px rgba(0, 0, 0, .4); transform: translateY(-2px); }
.pl-card[hidden] { display: none; }
.pl-main { display: block; padding: 18px 20px 10px; color: inherit; text-decoration: none; flex: 1; }
.pl-top { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pl-chip { font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--sand-light); color: #2b1f0b; }
.pl-lang { margin-left: auto; font-weight: 700; font-size: 11.5px; letter-spacing: .04em; }
.pl-card h3 { font-size: 18px; line-height: 1.25; margin-bottom: 8px; }
.pl-meta { font-size: 13.5px; color: var(--muted); margin: 0 0 4px; }
.pl-meta .ok { color: var(--ok); font-weight: 600; }
.pl-meta .warn { color: #8a5a00; font-weight: 600; }
.pl-act { display: flex; gap: 8px; padding: 0 20px 18px; }
.pl-act .btn:first-child { margin-right: auto; }
.pl-empty { text-align: center; padding: 60px 20px 80px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); margin: 16px 0 40px; }
.pl-empty .pl-new { justify-content: center; margin-top: 18px; }

.ke { padding: 18px 0 60px; }
.ke-bar { position: sticky; top: var(--tb, 68px); z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; background: rgba(250, 250, 247, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.ke-name { flex: 1 1 240px; min-width: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; padding: 6px 10px; }
.ke-name:hover { border-color: var(--line); }
.ke-name:focus { border-color: var(--ink); background: var(--surface); outline: none; }
.ke-status { font-size: 13px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ke-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.ke-status[data-s="dirty"]::before, .ke-status[data-s="saving"]::before { background: var(--sand-light); }
.ke-status[data-s="error"] { color: var(--madder); }
.ke-status[data-s="error"]::before { background: var(--madder); }
.ke-bar-r { display: flex; align-items: center; gap: 8px; }
.ke-ib { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ke-ib svg { width: 17px; height: 17px; }
.ke-ib.flip svg { transform: scaleX(-1); }
.ke-ib:disabled { opacity: .35; cursor: default; }
.ke-tip { color: var(--muted); font-size: 14px; margin: 14px 0 18px; }

.ke-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; }
.ke-side { position: sticky; top: calc(var(--tb, 68px) + 70px); display: grid; gap: 12px; max-height: calc(100vh - var(--tb, 68px) - 90px); overflow: auto; scrollbar-width: thin; padding-bottom: 4px; }
.ke-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.ke-cap { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.ke-total div { font-size: 14px; color: var(--muted); }
.ke-total b { font-size: 30px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.ke-meter { display: block; height: 6px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.ke-meter i { display: block; height: 100%; background: var(--sand-light); border-radius: 9px; transition: width .3s; }
.ke-total.ok .ke-meter i { background: #2fbf71; }
.ke-total.over .ke-meter i { background: var(--madder); }
.ke-total small { font-size: 13px; font-weight: 600; }
.ke-total.ok small { color: var(--ok); }
.ke-total.over small { color: var(--madder); }
.ke-ol { display: grid; gap: 1px; font-size: 13.5px; }
.ke-ol a { display: flex; gap: 8px; justify-content: space-between; padding: 5px 8px; border-radius: 7px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.ke-ol a:hover { background: var(--surface-2); color: var(--ink); }
.ke-ol a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ke-ol a.st { padding-left: 18px; }
.ke-ol a b { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ke-ol a.sub { font-weight: 600; }
.ke-adds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.ke-adds button { border: 1px dashed var(--line-strong); background: none; border-radius: 9px; padding: 8px 4px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.ke-adds button:hover { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.ke-libbtn { width: 100%; font-size: 14px; padding: 10px 12px; }
.ke-sw { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 5px 0; cursor: pointer; }
.ke-sw input { width: 17px; height: 17px; accent-color: var(--ink); }
.ke-more { display: grid; gap: 2px; }
.ke-more button { text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.ke-more button:hover { background: var(--surface-2); color: var(--ink); }
.ke-more button.danger { color: var(--madder); }

/* the sheet */
.ke-paper-wrap { min-width: 0; }
.ke-paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .35); padding: 44px 48px 36px 54px; max-width: 920px; margin: 0 auto; color: #161616; transition: max-width .3s; }
.ke-paper.land { max-width: 1200px; }
.ke-paper textarea, .ke-paper input { font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 6px; width: 100%; resize: none; padding: 5px 7px; line-height: 1.45; field-sizing: content; min-height: 0; overflow: hidden; display: block; }
.ke-paper textarea:hover, .ke-paper input:hover { background: #fbfaf5; }
.ke-paper textarea:focus, .ke-paper input:focus { outline: none; background: #fffdf3; border-color: var(--sand-light); box-shadow: 0 0 0 3px rgba(245, 200, 76, .25); }
.ke-paper textarea::placeholder, .ke-paper input::placeholder { color: #b9b9b2; }
.ke-h1 { text-align: center; font-size: 21px !important; font-weight: 800 !important; letter-spacing: -.01em; margin-bottom: 18px; }
.ke-h2 { font-size: 17px !important; font-weight: 800 !important; margin: 26px 0 10px; }
.ke-head { border: 1px solid #2a2a2a; border-bottom: 0; }
.ke-hrow { position: relative; display: grid; grid-template-columns: 30% minmax(0, 1fr); border-bottom: 1px solid #2a2a2a; font-size: 14.5px; }
.ke-lab { background: #f4f4ef !important; font-weight: 600; border-right: 1px solid #2a2a2a !important; border-radius: 0 !important; }
.ke-hrow textarea { border-radius: 0; }
.ke-stages { border: 1px solid #2a2a2a; border-bottom: 0; font-size: 14px; }
.ke-srow { position: relative; display: grid; border-bottom: 1px solid #2a2a2a; }
.ke-srow > .ke-cell, .ke-shead > textarea { border-right: 1px solid #2a2a2a; min-width: 0; }
.ke-srow > .ke-cell:last-of-type, .ke-shead > textarea:last-child { border-right: 0; }
.ke-shead { background: #f4f4ef; }
.ke-shead textarea { font-weight: 700; font-size: 13px; border-radius: 0; }
.ke-cell textarea { border-radius: 0; min-height: 100%; }
.ke-cell.first { display: flex; flex-direction: column; }
.ke-sname { font-weight: 700; }
.ke-min { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px 8px; font-size: 13px; color: var(--muted); }
.ke-min input { width: 58px; font-weight: 700; color: var(--ink); border: 1px solid var(--line) !important; border-radius: 7px !important; padding: 3px 6px; text-align: center; -moz-appearance: textfield; }
.ke-cl { display: none; }
.ke-block { position: relative; margin-top: 18px; padding-top: 2px; }
.ke-btitle { font-size: 16.5px !important; font-weight: 800 !important; }
.ke-btext { font-size: 14.5px; }
.ke-plus { display: block; margin: 8px 0 0; border: 1px dashed var(--line-strong); background: none; border-radius: 8px; padding: 7px 12px; width: 100%; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; opacity: .65; transition: opacity .15s; }
.ke-plus:hover { opacity: 1; color: var(--ink); border-color: var(--ink); }

/* row tools: drag handle on the left, actions on the right, "+" between stages */
.ke-handle { position: absolute; left: -30px; top: 6px; width: 22px; height: 28px; display: grid; grid-template-columns: repeat(2, 4px); gap: 3px 4px; align-content: center; justify-content: center; border-radius: 6px; cursor: grab; opacity: 0; transition: opacity .15s; }
.ke-handle i { width: 4px; height: 4px; border-radius: 50%; background: #9a9a92; }
.ke-handle:hover { background: var(--surface-2); }
.ke-tools { position: absolute; right: -2px; top: -15px; display: flex; gap: 2px; background: var(--ink); border-radius: 999px; padding: 3px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 3; }
.ke-tools button { width: 26px; height: 24px; border: 0; background: none; color: #fff; border-radius: 999px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.ke-tools button:hover { background: rgba(255, 255, 255, .18); }
.ke-tools button:disabled { opacity: .3; cursor: default; }
.ke-tools svg { width: 14px; height: 14px; }
.ke-tools .r90 { transform: rotate(90deg); }
.ke-tools .r270 { transform: rotate(270deg); }
.ke-ins { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--sand-light); color: #2b1f0b; font-weight: 800; line-height: 1; cursor: pointer; opacity: 0; z-index: 4; transition: opacity .15s; }
[data-list]:hover > .ke-handle, [data-list]:hover > .ke-tools, [data-list]:focus-within > .ke-tools, .ke-srow:hover > .ke-ins { opacity: 1; pointer-events: auto; }
.ke-dragging { opacity: .35; }
.drop-before { box-shadow: inset 0 3px 0 var(--sand); }
.drop-after { box-shadow: inset 0 -3px 0 var(--sand); }
.ke-flash { animation: keflash 1.3s ease; }
@keyframes keflash { 0%, 40% { background: #fff3c4; } 100% { background: transparent; } }

/* library drawer */
.ke-lib { position: fixed; inset: 0; z-index: 60; background: rgba(17, 18, 20, .35); display: flex; justify-content: flex-end; animation: kefade .2s ease; }
@keyframes kefade { from { opacity: 0; } }
.ke-lib-in { width: min(480px, 100%); height: 100%; background: var(--paper); display: flex; flex-direction: column; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .4); animation: keslide .25s ease; }
@keyframes keslide { from { transform: translateX(40px); } }
.ke-lib-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ke-lib-head h3 { margin: 0; font-size: 20px; }
.ke-lib-body { padding: 16px 20px 40px; overflow: auto; flex: 1; }
.ke-lib-grades { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ke-lib-grades button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 14px; cursor: pointer; }
.ke-lib-grades button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ke-lib-lesson { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 600; font-size: 15px; }
.ke-lib-lesson:hover:not(:disabled) { border-color: var(--ink); }
.ke-lib-lesson:disabled { opacity: .5; cursor: not-allowed; }
.ke-lib-lesson .par { flex: none; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sand-light); color: #2b1f0b; }
.ke-lib-lesson svg { width: 15px; height: 15px; margin-left: auto; flex: none; }
.ke-lib-back { border: 0; background: none; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; padding: 0; font-size: 14px; margin-bottom: 10px; }
.ke-lib-back svg { width: 15px; height: 15px; }
.ke-lib-title { font-size: 18px; margin-bottom: 12px; }
.ke-lib-all { margin-bottom: 18px; }
.ke-lib-sec { margin-bottom: 18px; }
.ke-lib-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ke-lib-item > div { min-width: 0; }
.ke-lib-item b { display: block; font-size: 14.5px; line-height: 1.3; }
.ke-lib-item small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.ke-lib-item .btn { flex: none; }
.ke-lib-item .btn.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

/* printing: only the clean copy of the plan */
.ksp-print { display: none; }
@media print {
  .ksp-print { display: block; }
  .ksp-print .ksp { border: 0; padding: 0; margin: 0; max-width: none; font-size: 11pt; }
}

@media (max-width: 980px) {
  .ke-grid { grid-template-columns: minmax(0, 1fr); }
  .ke-side { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .ke-paper { padding: 28px 22px 24px 34px; }
}
@media (max-width: 700px) {
  .ke-paper { padding: 18px 12px; border-radius: 4px; }
  .ke-hrow { grid-template-columns: minmax(0, 1fr); }
  .ke-lab { border-right: 0 !important; border-bottom: 1px solid #ddd !important; }
  .ke-shead { display: none !important; }
  .ke-srow { grid-template-columns: minmax(0, 1fr) !important; padding-top: 8px; }
  .ke-srow > .ke-cell { border-right: 0; border-bottom: 1px solid #e3e3dc; }
  .ke-srow > .ke-cell:last-of-type { border-bottom: 0; }
  .ke-cl { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 7px 0; }
  .ke-handle { display: none; }
  .ke-tools { opacity: 1; pointer-events: auto; position: static; justify-content: flex-end; margin: 4px 6px 8px auto; width: max-content; }
  .ke-block .ke-tools { margin-top: 4px; }
  .ke-ins { display: none; }
  .ke-bar { gap: 8px; }
  .ke-name { order: -1; flex-basis: 100%; font-size: 17px; }
}
@media (hover: none) { .ke-tools { opacity: 1; pointer-events: auto; } .ke-ins { opacity: 1; } }
.ke-cell.first .ke-sname { min-height: 0; flex: 0 0 auto; }
.ke-cell.first .ke-min { margin-top: auto; padding-top: 6px; }
.ke-ol a span { min-width: 0; flex: 1; }
.ke-side { overflow-x: hidden; }
.ke-side > * { min-width: 0; }
@media (max-width: 700px) { .ke-side > .ke-card:nth-child(2) { display: none; } }

/* ---------- phone layout (2026-12): compact header, bottom tab bar, compact lists ---------- */
.tabbar { display: none; }
.topic .meta > span:not(.tag) { display: block; }
.topic .meta .tag { margin-bottom: 4px; }
.acc-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-top [data-logout] { display: none; }

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  /* header: one compact row */
  .topbar .container { height: 56px !important; padding-top: 0 !important; padding-bottom: 0 !important; flex-wrap: nowrap !important; gap: 10px; }
  .brand-name { font-size: 21px; }
  .brand-name small { display: none; }
  .nav { flex-wrap: nowrap; gap: 6px; }
  .nav .wide { display: none !important; }
  .nav a { padding: 7px 8px; }
  .nav .btn-sm { padding: 7px 13px; }
  .lang { margin-left: 2px; }
  .lang button[aria-pressed="true"] { display: none; }
  .lang button { padding: 7px 10px; }

  /* bottom tab bar, like an app */
  body.has-tabbar { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  body.has-tabbar .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(250, 250, 247, .94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { background: var(--sand-light); border-radius: 10px; padding: 2px 10px; width: 46px; height: 28px; box-sizing: border-box; }
  .tabbar a:active { background: var(--surface-2); }
  body.has-tabbar .acc-top [data-logout] { display: inline-flex; }

  footer.site { margin-top: 32px; padding: 18px 0 24px; font-size: 12.5px; }
  .page-head { margin: 20px 0 14px; gap: 10px; }
  .page-head h1 { font-size: 30px; }
  h1 { font-size: 30px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }

  /* subject: grades as a swipeable row, lessons as compact rows */
  .ruler { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--r-md); }
  .ruler::-webkit-scrollbar { display: none; }
  .ruler > * { flex: 0 0 auto; min-width: 70px; scroll-snap-align: start; padding: 10px 8px 9px !important; }
  .ruler .num { font-size: 28px; }
  .ruler small { font-size: 11.5px; white-space: nowrap; }
  .grade-buy { padding: 14px; gap: 12px; }
  .grade-buy > div:first-child span { font-size: 13.5px; }
  .gb-actions, .gb-actions .btn { width: 100%; }
  .topic-list { margin-top: 16px; }
  .topic { grid-template-columns: 76px minmax(0, 1fr); gap: 4px 14px; padding: 14px 0; }
  .topic .thumb { width: 76px; grid-row: span 2; }
  .topic > .par { grid-row: span 2; font-size: 20px; }
  .topic h3 { font-size: 17px; line-height: 1.25; margin-bottom: 2px; }
  .topic .par[style] { font-size: 13px !important; }
  .topic p { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .topic .meta { grid-column: 2; text-align: left; white-space: normal; line-height: 1.4; font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
  .topic .meta > span:not(.tag) { display: inline; }
  .topic .meta > span:not(.tag) + span:not(.tag)::before { content: "·"; margin: 0 6px; }
  .topic .meta .tag { margin: 0 8px 0 0; }

  /* lesson page */
  .lx-head { padding: 14px 0 18px; gap: 14px; }
  .lx-cover button { border-radius: var(--r-md); }
  .lx-cover figcaption { display: none; }
  .lx-kick { margin: 2px 0 10px; }
  .lx-head h1 { font-size: 28px; margin-bottom: 8px; }
  .lx-src { font-size: 13.5px; }
  .lx-acts { margin: 16px 0 18px; display: grid; grid-template-columns: minmax(0, 1fr); }
  .lx-acts .btn { width: 100%; font-size: 16px; padding: 13px 18px; }
  .lx-nums { gap: 0; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
  .lx-nums div { align-items: center; flex: 1; }
  .lx-tabs { margin: 0 -16px 18px; padding: 8px 16px; gap: 8px; }
  .lx-tablist button { padding: 8px 13px; font-size: 14px; }
  .lx-clock { width: 100%; justify-content: space-between; }
  .lx-clock > .btn:only-child { width: 100%; }
  .lx-lead { font-size: 14px; margin-bottom: 14px; }
  .lx-side { padding: 2px 16px; }
  .lx-chip { font-size: 13px; padding: 8px 12px; }
  .lx-task { padding: 16px; }
  .lx-ref section { padding: 16px; }

  /* games */
  .ggrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gcard { padding: 14px 14px 12px; }
  .gfilters { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin-left: -16px !important; margin-right: -16px !important; padding: 0 16px 4px !important; }
  .gfilters::-webkit-scrollbar { display: none; }
  .gfilters > * { flex: none; }

  /* plans */
  .pl-new { width: 100%; }
  .pl-new > * { flex: 1 1 auto; }
  .pl-grid { grid-template-columns: minmax(0, 1fr); }
  .ke-bar { top: 56px; }
  .ke-tip { display: none; }
  .ke-bar .btn-sm { padding: 7px 11px; }
}
@media (max-width: 380px) {
  .tabbar a { font-size: 10.5px; }
  .nav a:not(.btn) { display: none; }
}
.nav a.btn-primary { background: var(--ink); color: #fff; }
.nav a.btn-primary:hover { background: #2c2c2a; color: #fff; }
.ruler a[aria-current="true"] { background: var(--ink); }
.ruler a[aria-current="true"] small { color: rgba(255, 255, 255, .7); }
.ruler a:hover:not([aria-current="true"]) { background: var(--surface-2); }
@media (max-width: 760px) {
  .nav { margin-left: auto !important; width: auto !important; justify-content: flex-end; }
  .topic .meta > span:last-child { display: none; }
  .gtabs { margin-bottom: 14px; }
}
.lx-goal > summary { display: none; }
@media (max-width: 760px) {
  .lx-goal > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
  .lx-goal > summary::-webkit-details-marker { display: none; }
  .lx-goal > summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); line-height: 1; }
  .lx-goal[open] > summary::after { content: "−"; }
  .lx-goal[open] > summary { border-bottom: 1px solid var(--line); }
  .lx-goal > section:first-of-type { border-top: 0; }
  .ke-grid { display: flex; flex-direction: column; }
  .ke-side { order: 2; }
  .ke-bar { position: static; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .deck::after, .stage.gk::after { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .8); font: 600 13px var(--sans); white-space: nowrap; pointer-events: none; }
  html[lang="kk"] .deck::after { content: "↻ Телефонды көлденең бұрыңыз"; }
  html[lang="ru"] .deck::after { content: "↻ Поверните телефон горизонтально"; }
}
