:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface2: #f0f2ef;
  --text: #1c1f1d;
  --text2: #5b625e;
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.28);
  --brand: #0F6E56;
  --brand-dark: #085041;
  --brand-light: #1D9E75;
  --accent-bg: #e1f5ee;
  --accent-bd: #1D9E75;
  --ok-bg: #e4f4e8;
  --ok-bd: #27ae60;
  --ok-tx: #1c6b3a;
  --no-bg: #fbe9e7;
  --no-bd: #e74c3c;
  --no-tx: #a5281b;
  --part-bg: #fdf1d6;
  --part-bd: #e0a100;
  --part-tx: #7a5600;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131615;
    --surface: #1c201e;
    --surface2: #252a27;
    --text: #eceeed;
    --text2: #a3aaa6;
    --border: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.32);
    --accent-bg: #14352b;
    --ok-bg: #153523;
    --ok-tx: #7fd6a0;
    --no-bg: #3a1c19;
    --no-tx: #f19a91;
    --part-bg: #3a2f0f;
    --part-tx: #f0c75a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, .selectable { -webkit-user-select: text; user-select: text; }
#app { width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; }
@media (min-width: 900px) {
  #app { padding: 20px 32px 64px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .qt { font-size: 18px; }
  .meta { font-size: 14px; }
  .tile { width: 46px; height: 46px; }
}
/* Кіру/тіркелу картасы кең экранда созылып кетпесін */
#app > .card:has(#em) { max-width: 480px; margin-left: auto; margin-right: auto; }
#app > .banner { max-width: 480px; margin-left: auto; margin-right: auto; }

.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 500; }
.logo b { color: var(--brand-light); font-weight: 500; }
.spacer { flex: 1; }
.who { font-size: 12px; color: var(--text2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

h2 { font-size: 18px; font-weight: 500; margin: 16px 0 8px; }
.meta { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.qt { font-size: 16px; font-weight: 500; line-height: 1.5; margin-bottom: 10px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 12px 0; }
.card.hero { background: var(--brand); border-color: var(--brand); color: #fff; }
.card.hero .meta { color: rgba(255, 255, 255, 0.85); }
.card.ctx { background: var(--surface2); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; text-align: left; color: var(--text); font: inherit; cursor: pointer; width: 100%;
}
.cell:hover { border-color: var(--border-strong); }
.cell i { font-size: 24px; color: var(--brand-light); display: block; }
.cell .n { font-weight: 500; margin-top: 6px; }
.cell .s { font-size: 13px; color: var(--text2); }

.btn {
  padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: transparent; color: var(--text); font: inherit; font-size: 15px; cursor: pointer;
}
.btn:hover { background: var(--surface2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-dark); }
.btn.white { background: #fff; border-color: #fff; color: var(--brand); }
.btn.link { border: none; padding: 6px 4px; color: var(--brand-light); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }

.tiles { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tile {
  width: 42px; height: 42px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; padding: 0;
}
.tile.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-tx); }
.tile.no { background: var(--no-bg); border-color: var(--no-bd); color: var(--no-tx); }
.tile.part { background: var(--part-bg); border-color: var(--part-bd); color: var(--part-tx); }
.tile.ans { background: var(--accent-bg); border-color: var(--accent-bd); }
.tile.cur { outline: 2px solid var(--text); outline-offset: 1px; }

.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 11px 12px; margin: 8px 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.opt:disabled { cursor: default; }
.opt .lt { font-weight: 500; min-width: 20px; color: var(--text2); }
.opt .tx { flex: 1; }
.opt i { font-size: 20px; color: var(--text2); }
.opt.on { border-color: var(--accent-bd); background: var(--accent-bg); }
.opt.good { border-color: var(--ok-bd); background: var(--ok-bg); }
.opt.bad { border-color: var(--no-bd); background: var(--no-bg); }

.mtable { width: 100%; border-collapse: collapse; border: 1px solid var(--accent-bd); margin: 6px 0 10px; }
.mtable td { border: 1px solid var(--accent-bd); padding: 10px 12px; vertical-align: middle; }
.mleft { width: 50%; font-weight: 500; }
.mlt { color: var(--text2); margin-right: 4px; }
.msel {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg, transparent); color: var(--text); font: inherit; cursor: pointer;
}
.msel:focus { outline: 2px solid var(--accent-bd); }
.msel:disabled { cursor: default; opacity: 1; }
.msel.good { border-color: var(--ok-bd); background: var(--ok-bg); }
.msel.bad { border-color: var(--no-bd); background: var(--no-bg); }
.mright-ans { margin-top: 6px; font-size: 13px; color: var(--text2); }
@media (max-width: 560px) {
  .mtable, .mtable tbody, .mtable tr, .mtable td { display: block; width: 100%; box-sizing: border-box; }
  .mleft { width: 100%; border-bottom: 0; }
}

.res { padding: 10px 12px; border-radius: var(--radius); margin: 10px 0; font-size: 14px; }
.res.ok { background: var(--ok-bg); color: var(--ok-tx); }
.res.no { background: var(--no-bg); color: var(--no-tx); }
.res.part { background: var(--part-bg); color: var(--part-tx); }
.err { font-size: 13px; color: var(--no-tx); margin: 8px 0; }
.note { font-size: 13px; color: var(--text2); margin: 8px 0; }
.banner { background: var(--part-bg); color: var(--part-tx); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

label.f { display: block; font-size: 13px; color: var(--text2); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
textarea { resize: vertical; }
.frow { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.frow .lt { min-width: 20px; font-weight: 500; color: var(--text2); }
.frow select { width: 90px; }

.big { font-size: 44px; font-weight: 500; color: var(--brand-light); line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.stats div { background: var(--surface2); border-radius: var(--radius); padding: 12px; font-size: 13px; color: var(--text2); }
.stats b { display: block; font-size: 22px; font-weight: 500; color: var(--text); }

.center { text-align: center; padding: 48px 8px; }
.center .ic { width: 68px; height: 68px; border-radius: 50%; background: var(--part-bg); color: var(--part-tx); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 32px; }
.spin { width: 36px; height: 36px; border: 3px solid var(--border-strong); border-top-color: var(--brand-light); border-radius: 50%; margin: 60px auto; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

#wm {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; pointer-events: none; display: none;
}
#cover {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; background: #000; color: #fff;
  display: none; align-items: center; justify-content: center; text-align: center; font-size: 18px; padding: 24px;
}
body.covered #cover { display: flex; }
body.covered #app { visibility: hidden; }

@media print {
  body * { display: none !important; }
  body::before { content: "Басып шығаруға болмайды."; display: block; }
}

.qimg { display: block; max-width: 100%; max-height: 360px; margin: 8px auto; border-radius: 8px; background: #fff; }

/* security (auto-added) */
@media print { html, body { display: none !important; } }
body:not(.is-admin) * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body:not(.is-admin) input, body:not(.is-admin) textarea, body:not(.is-admin) select, body:not(.is-admin) .selectable { -webkit-user-select: text; user-select: text; }
body:not(.is-admin) img { -webkit-user-drag: none; pointer-events: auto; }

/* Жол үзілімдері мен бос орындарды өзгертпей көрсету (формулалар үшін) */
.qt, .opt .tx, .card.ctx, .mright-ans { white-space: pre-wrap; overflow-wrap: anywhere; }
.katex { white-space: nowrap; }
.katex-display { overflow-x: auto; overflow-y: hidden; }

/* ===== Заманауи дизайн (қосымша қабат) ===== */
:root {
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06), 0 10px 24px rgba(0, 0, 0, 0.09);
}
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.45);
  }
}

/* 1. Көлеңкелер мен жұмсақ қозғалыс */
.card { border-radius: 18px; box-shadow: var(--shadow-sm); }
.cell {
  border-radius: 18px; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.cell:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-bd); }
.cell:active { transform: translateY(-1px) scale(0.99); }

/* 2. Басты карточка: градиент */
.card.hero {
  position: relative; overflow: hidden; border: none;
  background: linear-gradient(135deg, #085041 0%, #0F6E56 50%, #1D9E75 100%);
  box-shadow: 0 10px 30px rgba(15, 110, 86, 0.35);
}
.card.hero > * { position: relative; z-index: 1; }
.card.hero .qt { font-size: 20px; }

/* 3. Иконкалар: түсті шаршы фон */
.cell i {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px; font-size: 24px;
  background: var(--accent-bg); color: var(--brand); margin-bottom: 4px;
}
.cell .n { margin-top: 8px; font-size: 16px; }

/* 5. Жауап нұсқалары */
.opt {
  align-items: center; border-radius: 14px; padding: 12px 14px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.opt:not(:disabled):hover { border-color: var(--accent-bd); background: var(--surface2); }
.opt:not(:disabled):active { transform: scale(0.99); }
.opt .lt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border); font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.opt.on { box-shadow: 0 0 0 1px var(--accent-bd); }
.opt.on .lt { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt.good { box-shadow: 0 0 0 1px var(--ok-bd); }
.opt.good .lt { background: var(--ok-bd); border-color: var(--ok-bd); color: #fff; }
.opt.bad { box-shadow: 0 0 0 1px var(--no-bd); }
.opt.bad .lt { background: var(--no-bd); border-color: var(--no-bd); color: #fff; }
.opt i { font-size: 22px; }
.opt.on i { color: var(--brand-light); }

/* 6. Түймелер */
.btn {
  border-radius: 12px; padding: 10px 18px; font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:not(:disabled):active { transform: scale(0.96); }
.btn.pri { box-shadow: 0 4px 12px rgba(15, 110, 86, 0.28); }
.btn.pri:hover { box-shadow: 0 6px 16px rgba(15, 110, 86, 0.38); }
.btn.white { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); font-weight: 600; }
.btn.white:hover { background: #f1faf6; }

/* 8. Сұрақ нөмірлері: дөңгелек */
.tiles { gap: 8px; }
.tile {
  border-radius: 50%; font-weight: 500;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.tile:hover { transform: scale(1.1); border-color: var(--accent-bd); }
.tile.ans { background: var(--accent-bg); border-color: var(--accent-bd); color: var(--brand); }
.tile.cur { outline: 2px solid var(--brand); outline-offset: 2px; font-weight: 700; }

/* Жұмсақ ұсақ жақсартулар */
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  border-radius: 12px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-bd); box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.22);
}
.res, .banner, .stats div { border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
  .cell, .opt, .btn, .tile { transition: none; }
  .cell:hover, .tile:hover { transform: none; }
}

/* Есептің шығарылу жолы */
.sol { margin-top: 12px; border: 1px solid var(--accent-bd); border-radius: 12px; background: var(--accent-bg); overflow: hidden; }
.sol summary { cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 600; color: var(--brand); display: flex; align-items: center; gap: 8px; user-select: none; }
.sol summary::-webkit-details-marker { display: none; }
.sol summary::after { content: '\203A'; margin-left: auto; font-size: 20px; line-height: 1; transition: transform .15s; }
.sol[open] summary::after { transform: rotate(90deg); }
.sol .solb { padding: 0 14px 14px; font-size: 15px; line-height: 1.6; }
.sol .sl { margin: 2px 0; }
.sol .sl b { color: var(--brand); margin-right: 4px; }
.sol .sl.ans { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--accent-bd); font-weight: 600; }
@media (prefers-color-scheme: dark) { .sol summary, .sol .sl b { color: var(--brand-light); } }

/* ---------- Физика теория ---------- */
.th-home .qt i { color: var(--brand-light); margin-right: 4px; }
.th-topic { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.th-topic:hover { border-color: var(--accent-bd); }
.th-ref { font-size: 13px; color: var(--text2); margin: 8px 0 4px; display: grid; gap: 2px; }
.th-ref i { color: var(--brand-light); }
.th-ref.sm { margin: 0 0 10px; }
.th-list { display: grid; gap: 8px; margin: 12px 0; }
.th-li { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.th-li:hover { border-color: var(--accent-bd); }
.th-no { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--accent-bg); color: var(--brand-light); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.th-lt { display: block; font-weight: 500; }
.th-lm { display: block; font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.th-art { padding: 18px 20px; }
.th-crumb { font-size: 12.5px; color: var(--text2); }
.th-h { font-size: 21px; font-weight: 600; margin: 4px 0 6px; line-height: 1.3; }
.th-body { font-size: 16.5px; line-height: 1.65; overflow-wrap: anywhere; }
.th-body p { margin: 10px 0; }
.th-body ul, .th-body ol { margin: 8px 0; padding-left: 22px; }
.th-body li { margin: 5px 0; }
.th-f { margin: 12px 0; padding: 10px 12px; background: var(--surface2); border-radius: 10px; overflow-x: auto; text-align: center; }
.th-def { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--brand-light); background: var(--accent-bg); border-radius: 0 10px 10px 0; }
.th-tip { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--ok-bd); background: var(--ok-bg); border-radius: 0 10px 10px 0; }
.th-tip b:first-child { color: var(--ok-tx); }
.th-warn { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--part-bd); background: var(--part-bg); border-radius: 0 10px 10px 0; }
.th-warn b:first-child { color: var(--part-tx); }
.th-tw { overflow-x: auto; margin: 12px 0; }
.th-t { border-collapse: collapse; width: 100%; font-size: 15px; }
.th-t th, .th-t td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.th-t th { background: var(--surface2); font-weight: 600; }
.th-fig { margin: 14px auto; max-width: 440px; }
.th-fig figcaption { font-size: 13px; color: var(--text2); text-align: center; margin-top: 4px; }
.th-svg { width: 100%; height: auto; display: block; color: var(--text); }
.th-svg text { fill: currentColor; font-family: inherit; }
.th-svg .sk { stroke: currentColor; }
.th-svg .sa { stroke: var(--brand-light); }
.th-svg .sb { stroke: #E8772E; }
.th-svg .fk, .th-svg [fill="currentColor"] { fill: currentColor; }
.th-svg .fa, #ARa path { fill: var(--brand-light); }
.th-svg .fb, #ARb path { fill: #E8772E; }
.th-svg .fill-a { fill: var(--brand-light); fill-opacity: .22; }
.th-svg circle.fill-a, .th-svg rect.fill-a { fill-opacity: 1; }
.th-svg .fill-b { fill: #E8772E; }
.th-svg .fill-s { fill: var(--surface2); }
.th-svg .fill-c { fill: var(--surface); }
.th-svg .dash { stroke-dasharray: 5 4; }
.th-svg text.ta { fill: var(--brand-light); font-weight: 600; }
.th-svg text.tb2 { fill: #E8772E; font-weight: 600; }
.th-svg text.tw { fill: #fff; font-weight: 700; }
.th-nav { justify-content: space-between; }
@media (max-width: 520px) { .th-art { padding: 14px 14px; } .th-body { font-size: 16px; } }
.th-t td, .th-t th { overflow-wrap: normal; word-break: normal; hyphens: auto; }
.th-t { min-width: 480px; }

.th-books { display: grid; gap: 12px; margin-top: 12px; }
.th-books .card { margin: 0; }
.th-book .qt i { color: var(--brand-light); }
.th-body p .katex, .th-body li .katex, .th-def .katex, .th-tip .katex, .th-warn .katex { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; padding: 2px 0; }
.th-f .katex-display { margin: 0; }

/* Тегін көру және «Промокод алу» (WhatsApp) */
a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn.wa { background: #25D366; border-color: #25D366; color: #fff; font-weight: 600; }
.btn.wa:hover { background: #1ebe5b; }
.btn.wa.sm { padding: 6px 10px; font-size: 14px; }
.card.lock { border-style: dashed; }
.card.lock .qt i { color: var(--text2); }
.card.guest .row { flex-wrap: wrap; }
.th-topic.locked { opacity: 0.6; }

/* ===== Басты бет және ішкі беттер (2026-11) ===== */
:root {
  --c-sec: #0F6E56; --c-sec-bg: #e1f5ee;
  --c-test: #d9631c; --c-test-bg: #fff0e5;
  --c-th: #2f5fd0; --c-th-bg: #e8eefc;
  --c-var: #7a43c9; --c-var-bg: #f1e9fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-sec: #4fd1a5; --c-sec-bg: #14352b;
    --c-test: #ffa264; --c-test-bg: #3a2414;
    --c-th: #8eabff; --c-th-bg: #1b2647;
    --c-var: #c39bff; --c-var-bg: #2c1d44;
  }
}
body { background: radial-gradient(1200px 500px at 10% -10%, var(--accent-bg), transparent 60%), var(--bg); background-attachment: fixed; }

/* Жоғарғы жолақ */
.top {
  position: sticky; top: 0; z-index: 20; margin: -16px -16px 14px; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .top { margin: -20px -32px 18px; padding: 12px 32px; } }
.logo.as-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 22px; font-weight: 500; color: var(--text); cursor: pointer; }
.btn.ghost { border-color: transparent; background: var(--surface); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--surface2); }
.btn.ghost i, .btn i { vertical-align: -2px; }
.btn.hm { padding: 7px 12px; font-size: 14px; }
@media (max-width: 520px) { .btn.hm { display: none; } .who { display: none; } }
.row.back { margin: 0 0 6px; }
.pg-head { margin: 6px 0 4px; }
.pg-head h2 { font-size: 24px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -0.01em; }
h2 { font-weight: 600; }

/* Сәлемдесу блогы */
.welcome {
  position: relative; overflow: hidden; border-radius: 22px; padding: 22px 20px; margin: 4px 0 16px; color: #fff;
  background: linear-gradient(135deg, #064234 0%, #0F6E56 55%, #1D9E75 100%);
  box-shadow: 0 14px 34px rgba(15, 110, 86, 0.32);
}
.welcome::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.55), rgba(255, 138, 61, 0) 70%);
}
.welcome > * { position: relative; z-index: 1; }
.w-kick { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.welcome h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 8px; font-weight: 700; letter-spacing: -0.01em; }
.welcome p { margin: 0; opacity: 0.9; max-width: 640px; font-size: 15px; }
.w-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.w-stats div { background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 14px; padding: 10px 12px; }
.w-stats b { display: block; font-size: 22px; font-weight: 700; line-height: 1.15; }
.w-stats span { font-size: 12px; opacity: 0.85; }
@media (max-width: 520px) { .w-stats { grid-template-columns: repeat(2, 1fr); } .welcome h1 { font-size: 22px; } }
@media (min-width: 900px) { .welcome { padding: 32px 34px; } .welcome h1 { font-size: 34px; } }

.banner.guest-b { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }

/* 4 негізгі бөлім */
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 6px 0 20px; }
.mtile {
  --c: var(--c-sec); --cb: var(--c-sec-bg);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; width: 100%;
  padding: 18px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mtile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); opacity: 0.9; }
.mtile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--c); }
.mtile:active { transform: translateY(-1px) scale(0.99); }
.mtile.t-test { --c: var(--c-test); --cb: var(--c-test-bg); }
.mtile.t-th { --c: var(--c-th); --cb: var(--c-th-bg); }
.mtile.t-var { --c: var(--c-var); --cb: var(--c-var-bg); }
.mt-ic { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--cb); color: var(--c); font-size: 28px; margin-bottom: 4px; }
.mt-t { font-size: 19px; font-weight: 700; }
.mt-d { font-size: 14px; color: var(--text2); line-height: 1.45; flex: 1; }
.mt-f { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.mt-f i { transition: transform 0.18s ease; }
.mtile:hover .mt-f i { transform: translateX(4px); }
@media (max-width: 520px) {
  .menu { grid-template-columns: 1fr; gap: 10px; }
  .mtile { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; row-gap: 2px; padding: 14px; }
  .mt-ic { grid-row: 1 / span 3; margin: 0; }
  .mt-d { font-size: 13px; }
  .mt-f { margin-top: 2px; }
}

/* Бөлім карталарындағы прогресс */
.bar { height: 6px; border-radius: 6px; background: var(--surface2); margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); border-radius: 6px; }
.cell .n { font-weight: 600; }

/* Сұрақ картасы */
.card .qt { font-size: 17px; }
.card .meta:first-child { display: inline-block; background: var(--surface2); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .mtile, .mt-f i { transition: none; } .mtile:hover { transform: none; } }

/* Ақшыл жасыл фон */
:root { --bg: #e6f5ee; --surface2: #eef7f2; }
@media (prefers-color-scheme: dark) { :root { --bg: #102019; --surface2: #1f2d27; } }
body { background: radial-gradient(1100px 520px at 0% -10%, #c9eedd, transparent 60%), radial-gradient(900px 480px at 100% 0%, #d8f3e6, transparent 60%), var(--bg); background-attachment: fixed; }
@media (prefers-color-scheme: dark) { body { background: radial-gradient(1100px 520px at 0% -10%, #15392b, transparent 60%), var(--bg); background-attachment: fixed; } }

/* ===== KazPhys көрнекі қабат (2026-11-02) ===== */
:root { --sig: #FF8A3D; --deep: #063A2E; --ff: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --fd: "Unbounded", "Golos Text", system-ui, sans-serif; }
body { font-family: var(--ff); }
.logo span { font-family: var(--fd); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.logo b { color: var(--brand-light); font-weight: 700; }
.pg-head h2, .mt-t, .g-open h2 { font-family: var(--fd); font-weight: 700; letter-spacing: -0.02em; }

/* Басты экран: осциллограф — тор және синусоида */
.hero2 {
  position: relative; overflow: hidden; isolation: isolate; color: #eafff6;
  border-radius: 28px; padding: 30px 22px 22px; margin: 4px 0 18px;
  background-color: var(--deep);
  background-image:
    linear-gradient(rgba(127, 230, 190, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 230, 190, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(127, 230, 190, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 230, 190, 0.04) 1px, transparent 1px),
    radial-gradient(120% 90% at 85% 40%, #0F6E56 0%, var(--deep) 70%);
  background-size: 64px 64px, 64px 64px, 16px 16px, 16px 16px, 100% 100%;
  box-shadow: 0 18px 40px rgba(6, 58, 46, 0.35);
}
.h-wave { position: absolute; z-index: -1; right: -4%; top: 6%; width: 78%; height: 88%; opacity: 0.9; }
.h-axis { stroke: rgba(127, 230, 190, 0.28); stroke-width: 1.5; fill: none; stroke-dasharray: 4 6; }
.h-sine { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; opacity: 0.92;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: h-draw 1.8s cubic-bezier(.6, .1, .3, 1) .15s forwards; }
.h-dot { fill: var(--sig); opacity: 0; transform-origin: 375px 40px; animation: h-pop .45s ease-out 1.25s forwards;
  filter: drop-shadow(0 0 14px rgba(255, 138, 61, 0.75)); }
@keyframes h-draw { to { stroke-dashoffset: 0; } }
@keyframes h-pop { 0% { opacity: 0; transform: scale(0.2); } 70% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
.h-txt { max-width: 560px; }
.hero2 h1 { font-family: var(--fd); font-weight: 700; font-size: clamp(28px, 6.4vw, 52px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; text-wrap: balance; }
.hero2 p { margin: 0; font-size: 16px; line-height: 1.55; color: rgba(234, 255, 246, 0.82); max-width: 46ch; }
.h-read { display: flex; flex-wrap: wrap; gap: 0; margin-top: 26px; border-top: 1px solid rgba(127, 230, 190, 0.25); }
.h-read div { padding: 12px 22px 0 0; margin-right: 22px; border-right: 1px solid rgba(127, 230, 190, 0.18); }
.h-read div:last-child { border-right: 0; margin-right: 0; }
.h-read b { display: block; font-family: var(--fd); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.h-read span { font-size: 13px; color: rgba(234, 255, 246, 0.7); }
@media (min-width: 900px) { .hero2 { padding: 52px 48px 34px; } .h-wave { width: 62%; } }
@media (max-width: 520px) {
  .hero2 { padding: 24px 18px 18px; border-radius: 22px; }
  .h-wave { width: 130%; right: -45%; top: auto; bottom: -4%; height: 52%; opacity: 0.3; }
  .h-read div { padding-right: 14px; margin-right: 14px; }
  .h-read b { font-size: 20px; }
}

/* Қонақтарға: не ашық және қалай ашылады */
.g-open { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; margin: 0 0 22px; align-items: start; }
.g-open h2 { font-size: 17px; margin: 0 0 12px; }
.g-free, .g-steps { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; }
.g-free ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.g-free li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.g-free li i { color: var(--brand-light); font-size: 20px; flex: 0 0 auto; margin-top: -1px; }
.g-steps { border: 2px solid var(--brand); background: linear-gradient(var(--surface), var(--surface)) padding-box; }
.g-steps ol { list-style: none; margin: 0 0 6px; padding: 0; counter-reset: st; display: grid; gap: 4px; }
.g-steps li { counter-increment: st; position: relative; padding: 4px 0 14px 46px; }
.g-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--fd); font-weight: 700; font-size: 14px; background: var(--brand); color: #fff; }
.g-steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--accent-bg); }
.g-steps li:last-child::before { background: var(--sig); }
.g-steps b { display: block; font-size: 15px; }
.g-steps span { font-size: 14px; color: var(--text2); }
.g-steps .row { margin: 4px 0 0; }
@media (max-width: 720px) { .g-open { grid-template-columns: 1fr; } }

/* Негізгі 4 бөлім: формула белгісі */
.mtile::before { display: none; }
.mtile { border-radius: 22px; padding: 20px; min-height: 190px; }
.mt-fx { position: absolute; right: 14px; top: 10px; font-family: var(--fd); font-weight: 700; font-size: 30px; letter-spacing: -0.03em;
  color: var(--c); opacity: 0.11; pointer-events: none; white-space: nowrap; transition: opacity .2s ease; }
.mtile:hover .mt-fx { opacity: 0.22; }
.mt-ic { border-radius: 14px; }
.mt-t { font-size: 18px; }
@media (max-width: 520px) { .mtile { min-height: 0; } .mt-fx { font-size: 22px; top: 8px; } }

/* Бөлім карталары */
.cell { border-radius: 18px; }
.cell .n { font-family: var(--fd); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .h-sine { animation: none; stroke-dashoffset: 0; }
  .h-dot { animation: none; opacity: 1; }
}

/* Мобильде жоғарғы жолақ бір қатарда тұрсын */
@media (max-width: 520px) {
  .top { flex-wrap: nowrap; gap: 6px; }
  .top .btn { padding: 7px 12px; font-size: 14px; white-space: nowrap; }
  .logo span { font-size: 18px; }
}

/* ===== Прогресс, рейтинг, статистика ===== */
.me-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 20px; }
.me-card { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.me-card:hover { border-color: var(--accent-bd); }
.me-card i { font-size: 24px; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-bg); color: var(--brand); }
.me-card:nth-child(2) i { background: #fff1e4; color: #d9631c; }
.me-card b { display: block; font-size: 16px; }
.me-card small { display: block; font-size: 13px; color: var(--text2); }
@media (prefers-color-scheme: dark) { .me-card i { color: var(--brand-light); } .me-card:nth-child(2) i { background: #3a2414; color: #ffa264; } }

.me-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.me-sum div { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.me-sum b { display: block; font-family: var(--fd); font-weight: 700; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.me-sum span { font-size: 13px; color: var(--text2); }
.me-sec { margin: 10px 0; font-size: 14px; }
.me-sec .bar { margin-top: 5px; }

.tr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.tr-row:first-of-type { border-top: 0; }
.tr-row b { display: block; font-size: 15px; font-weight: 600; }
.tr-row span { font-size: 13px; color: var(--text2); }
.tr-score { font-family: var(--fd); font-weight: 700; font-size: 16px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tr-score.ok { background: var(--ok-bg); color: var(--ok-tx); }
.tr-score.part { background: var(--part-bg); color: var(--part-tx); }
.tr-score.no { background: var(--no-bg); color: var(--no-tx); }
.tr-secs { font-size: 12.5px; color: var(--text2); margin: -4px 0 6px; line-height: 1.5; }

/* Рейтинг: жоғарғы үшеуі бөлек */
.lb { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.lb li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.lb li.me { border: 2px solid var(--brand-light); }
.lb-n { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--fd); font-weight: 700; font-size: 14px; background: var(--surface2); color: var(--text2); }
.lb li.top1 .lb-n { background: #f5b301; color: #3d2c00; }
.lb li.top2 .lb-n { background: #c9d1d6; color: #2a3236; }
.lb li.top3 .lb-n { background: #d9894a; color: #fff; }
.lb li.top1 { background: linear-gradient(90deg, rgba(245, 179, 1, 0.14), var(--surface) 60%); }
.lb-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lb-name em { font-style: normal; color: var(--brand-light); font-weight: 500; }
.lb-name small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text2); }
.lb-b { font-family: var(--fd); font-weight: 700; font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-b small { font-size: 13px; color: var(--text2); font-weight: 500; }

/* Админ: оқушылар кестесі */
.st-list { padding: 6px 8px; }
.st-head, .st-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 0.9fr 0.6fr 1fr 1.3fr; gap: 10px; align-items: center; padding: 10px 10px; }
.st-head { font-size: 12.5px; color: var(--text2); border-bottom: 1px solid var(--border); }
.st-row { width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 10px; }
.st-row:hover, .st-row.on { background: var(--surface2); }
.st-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row small { display: block; font-size: 12px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row span small { display: inline; }
.st-row > span:first-child small { display: block; }
.st-det { padding: 6px 14px 14px; border-bottom: 1px solid var(--border); background: var(--surface2); border-radius: 0 0 12px 12px; margin-bottom: 4px; }
@media (max-width: 620px) {
  .st-head { display: none; }
  .st-row { grid-template-columns: 1fr auto; grid-template-areas: "n b" "s t" "d d"; row-gap: 2px; }
  .st-row > span:nth-child(1) { grid-area: n; }
  .st-row > span:nth-child(2) { grid-area: s; font-size: 13px; color: var(--text2); }
  .st-row > span:nth-child(2)::before { content: "Шешті: "; }
  .st-row > span:nth-child(3) { grid-area: t; font-size: 13px; color: var(--text2); text-align: right; }
  .st-row > span:nth-child(3)::after { content: " тест"; }
  .st-row > span:nth-child(4) { grid-area: b; font-weight: 700; text-align: right; }
  .st-row > span:nth-child(5) { grid-area: d; font-size: 12px; color: var(--text2); }
}

/* Тест пен талдау: жоғарғы жолақтағы 40 сұрақ нөмірі (бір қатар, көлденең айналады) */
.top .qbar {
  flex: 1 0 100%; order: 10; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  gap: 6px; margin: 4px 0 0; padding: 6px 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.top:has(.qbar) { flex-wrap: wrap; }
.qbar .tile { flex: 0 0 auto; width: 36px; height: 36px; font-size: 13px; }
.qbar .tile:hover { transform: none; }
@media (min-width: 900px) { .qbar .tile { width: 40px; height: 40px; font-size: 14px; } }
.qnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.qnav .qarr {
  width: 52px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); border-color: var(--brand); color: #fff; font-size: 30px; line-height: 1; font-weight: 700;
}
.qnav .qarr:hover { background: var(--brand-dark); }
.qpos { font-weight: 700; font-size: 16px; color: var(--text2); }

/* ===== Көзге жайлы қабат: сұр-көк фон + WhatsApp жасылы (2026-11-12) ===== */
:root {
  --bg: #eef2f6; --surface: #fbfcfd; --surface2: #e8edf3;
  --text: #1f2a33; --text2: #5a6773;
  --border: rgba(20, 35, 55, 0.11); --border-strong: rgba(20, 35, 55, 0.24);
  --brand: #1DAA61; --brand-dark: #128C4B; --brand-light: #1DAA61;
  --accent-bg: #e2f6e9; --accent-bd: #25D366;
  --c-sec: #1DAA61; --c-sec-bg: #e2f6e9;
  --deep: #0B3B26;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161b; --surface: #1a2027; --surface2: #222a33;
    --text: #dbe2e8; --text2: #95a1ac;
    --border: rgba(220, 235, 255, 0.10); --border-strong: rgba(220, 235, 255, 0.24);
    --brand-light: #25D366; --accent-bg: #12301f;
    --c-sec: #25D366; --c-sec-bg: #12301f;
  }
}
body { background: radial-gradient(1000px 420px at 0% -10%, #dde6f0, transparent 60%), var(--bg); background-attachment: fixed; }
@media (prefers-color-scheme: dark) { body { background: radial-gradient(1000px 420px at 0% -10%, #18212b, transparent 60%), var(--bg); background-attachment: fixed; } }

/* Логотип пен градиенттер жаңа жасылға */
.logo svg rect { fill: var(--brand); }
.card.hero, .welcome { background: linear-gradient(135deg, #0E6B3C 0%, #1DAA61 60%, #25D366 100%); box-shadow: 0 12px 30px rgba(29, 170, 97, 0.30); }
/* Басты экран: WhatsApp жасылы (мәтін тұрған сол жағы сәл қою — оқуға анық) */
.hero2 {
  color: #fff; background-color: #128C4B;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(120% 100% at 85% 40%, #25D366 0%, #1DAA61 45%, #128C4B 100%);
  box-shadow: 0 18px 40px rgba(29, 170, 97, 0.35);
}
.hero2 p { color: rgba(255, 255, 255, 0.92); }
.h-axis { stroke: rgba(255, 255, 255, 0.40); }
.h-read { border-top-color: rgba(255, 255, 255, 0.30); }
.h-read div { border-right-color: rgba(255, 255, 255, 0.25); }
.h-read span { color: rgba(255, 255, 255, 0.85); }
.btn.pri { box-shadow: 0 4px 12px rgba(29, 170, 97, 0.28); }
.btn.pri:hover { box-shadow: 0 6px 16px rgba(29, 170, 97, 0.38); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.25); }

/* Ұзақ оқылатын мәтін: жол ұзындығы шектеулі */
.th-art { max-width: 780px; margin-left: auto; margin-right: auto; }
.th-body { line-height: 1.75; }
.card .qt, .opt .tx { max-width: 72ch; }

/* ===== Оқушы таңдайтын тақырып: түймемен ауыстырылады (жүйе баптауынан басым) ===== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f6; --surface: #fbfcfd; --surface2: #e8edf3; --text: #1f2a33; --text2: #5a6773;
  --border: rgba(20, 35, 55, 0.11); --border-strong: rgba(20, 35, 55, 0.24);
  --brand-light: #1DAA61; --accent-bg: #e2f6e9;
  --ok-bg: #e4f4e8; --ok-tx: #1c6b3a; --no-bg: #fbe9e7; --no-tx: #a5281b; --part-bg: #fdf1d6; --part-tx: #7a5600;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06), 0 10px 24px rgba(0, 0, 0, 0.09);
  --c-sec: #1DAA61; --c-sec-bg: #e2f6e9; --c-test: #d9631c; --c-test-bg: #fff0e5;
  --c-th: #2f5fd0; --c-th-bg: #e8eefc; --c-var: #7a43c9; --c-var-bg: #f1e9fb;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161b; --surface: #1a2027; --surface2: #222a33; --text: #dbe2e8; --text2: #95a1ac;
  --border: rgba(220, 235, 255, 0.10); --border-strong: rgba(220, 235, 255, 0.24);
  --brand-light: #25D366; --accent-bg: #12301f;
  --ok-bg: #153523; --ok-tx: #7fd6a0; --no-bg: #3a1c19; --no-tx: #f19a91; --part-bg: #3a2f0f; --part-tx: #f0c75a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.45);
  --c-sec: #25D366; --c-sec-bg: #12301f; --c-test: #ffa264; --c-test-bg: #3a2414;
  --c-th: #8eabff; --c-th-bg: #1b2647; --c-var: #c39bff; --c-var-bg: #2c1d44;
}
:root[data-theme="light"] body { background: radial-gradient(1000px 420px at 0% -10%, #dde6f0, transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="dark"] body { background: radial-gradient(1000px 420px at 0% -10%, #18212b, transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="light"] .sol summary, :root[data-theme="light"] .sol .sl b { color: var(--brand); }
:root[data-theme="dark"] .sol summary, :root[data-theme="dark"] .sol .sl b { color: var(--brand-light); }
:root[data-theme="light"] .me-card i { color: var(--brand); }
:root[data-theme="dark"] .me-card i { color: var(--brand-light); }
/* Серия картасы бірінші тұрғандықтан, иконка түстері реттік нөмірмен емес, әрекетпен беріледі */
.me-card[data-act="me"] i { background: var(--accent-bg); }
.me-card[data-act="lb"] i { background: #fff1e4; color: #d9631c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .me-card[data-act="lb"] i { background: #3a2414; color: #ffa264; } }
:root[data-theme="dark"] .me-card[data-act="lb"] i { background: #3a2414; color: #ffa264; }

/* Жоғарғы жолақтағы Aa және ай/күн түймелері */
.btn.ib { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; flex: 0 0 auto; }
.btn.ib i { font-size: 20px; vertical-align: 0; }
@media (max-width: 520px) {
  .top .btn.ib { width: 36px; height: 36px; padding: 0; }
  /* Телефонда жолақ сыйсын: «Промокод алу» тек белгішемен, админде логотип мәтіні жасырылады */
  .top .btn.wa.sm { font-size: 0; gap: 0; width: 36px; height: 36px; padding: 0; justify-content: center; }
  .top .btn.wa.sm i { font-size: 20px; }
  .top:has([data-act="admin"]) .logo span { display: none; }
  .top { overflow: hidden; }
}

/* Әріп өлшемі (Aa түймесі --fsk мәнін 1 / 1.12 / 1.25 етіп ауыстырады) */
.card .qt { font-size: calc(17px * var(--fsk, 1)); }
.opt .tx, .mtable td, .card.ctx { font-size: calc(16px * var(--fsk, 1)); }
.th-body { font-size: calc(16.5px * var(--fsk, 1)); }
.sol .solb { font-size: calc(15px * var(--fsk, 1)); }
@media (max-width: 520px) { .th-body { font-size: calc(16px * var(--fsk, 1)); } }

/* Таңдалған жауап айқын: сол жақта қалың жолақ */
.opt.on { box-shadow: inset 5px 0 0 var(--brand), 0 0 0 1px var(--accent-bd); }
.opt.on i { color: var(--brand); }
.opt.good { box-shadow: inset 5px 0 0 var(--ok-bd), 0 0 0 1px var(--ok-bd); }
.opt.bad { box-shadow: inset 5px 0 0 var(--no-bd), 0 0 0 1px var(--no-bd); }

/* Дұрыс жауап: белгі секіріп шығады */
.res.ok { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.res.ok i { font-size: 20px; }
.res.ok.pop { animation: kp-glow 0.9s ease-out; }
.res.ok.pop i { animation: kp-pop 0.5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes kp-pop { 0% { transform: scale(0.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes kp-glow { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); } }

/* Тест кезіндегі зейін режимі: безендіру жасырылады */
body.focus { background: var(--bg); }
body.focus .top .logo, body.focus .top .spacer + .btn.ghost.hm { display: none; }
body.focus #app > .meta, body.focus .banner { display: none; }
body.focus .card { box-shadow: none; }
body.focus #app > .card, body.focus .qnav, body.focus #app > .row:not(.back) { max-width: 820px; margin-left: auto; margin-right: auto; }
body.focus .top .qbar { margin-top: 0; }

/* Бөлім карталарындағы прогресс шеңбері */
.cell.rc { position: relative; }
.cell.rc .n { padding-right: 52px; }
.ring { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; }
.ring circle { fill: none; stroke-width: 4; }
.ring .rg-bg { stroke: var(--surface2); }
.ring .rg-fg { stroke: var(--brand); stroke-linecap: round; }
.ring text { font-size: 9.5px; font-weight: 700; fill: var(--text2); font-family: var(--ff); }

/* Күнделікті серия */
.me-card.sk i { background: #fff1e4; color: #d9631c; }
.me-card.sk.lit i { background: #FF8A3D; color: #fff; }
.sk-w { display: flex; gap: 4px; margin-top: 6px; }
.sk-d { font-size: 10.5px; line-height: 1; padding: 4px 0; width: 24px; text-align: center; border-radius: 6px; background: var(--surface2); color: var(--text2); }
.sk-d.on { background: var(--accent-bg); color: var(--brand); font-weight: 700; }
.sk-d.now { outline: 1.5px solid var(--border-strong); }
:root[data-theme="dark"] .me-card.sk:not(.lit) i { background: #3a2414; color: #ffa264; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .me-card.sk:not(.lit) i { background: #3a2414; color: #ffa264; } }
:root[data-theme="dark"] .sk-d.on { color: var(--brand-light); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sk-d.on { color: var(--brand-light); } }

/* Телефонда: төменгі навигация және ықшам басты блок */
.bnav { display: none; }
@media (max-width: 640px) {
  .bnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 11px; color: var(--text2); cursor: pointer; }
  .bnav button i { font-size: 22px; }
  .bnav button.on { color: var(--brand); font-weight: 600; }
  body.has-bnav #app { padding-bottom: 88px; }}
@media (max-width: 520px) {
  .hero2 { padding: 18px 16px 14px; margin-bottom: 12px; }
  .hero2 h1 { font-size: 24px; margin-bottom: 4px; }
  .hero2 p { display: none; }
  .h-read { margin-top: 12px; }
  .h-read b { font-size: 18px; }
  .h-read span { font-size: 12px; }
  .h-wave { opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) { .res.ok.pop, .res.ok.pop i { animation: none; } }

/* Сәйкестендіру: телефонда да компьютердегідей тізім, таңдалған жол анық белгіленеді */
.mbtn { display: flex; align-items: center; gap: 8px; text-align: left; background: var(--surface); font-size: calc(16px * var(--fsk, 1)); }
.mbtn span { flex: 1; }
.mbtn i { font-size: 18px; color: var(--text2); }
.mbtn.set { background: var(--accent-bg); border-color: var(--accent-bd); box-shadow: inset 5px 0 0 var(--brand); font-weight: 600; }
.mbtn.open { border-color: var(--accent-bd); box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.22); }
.mbtn.set.open { box-shadow: inset 5px 0 0 var(--brand), 0 0 0 3px rgba(37, 211, 102, 0.22); }
.mbtn:disabled { cursor: default; }
.mlist { margin-top: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-md); }
.mopt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; min-height: 46px;
  border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: calc(16px * var(--fsk, 1)); cursor: pointer;
}
.mopt:first-child { border-top: 0; }
.mopt span { flex: 1; }
.mopt:hover, .mopt:focus-visible { background: var(--surface2); outline: none; }
.mopt.on { background: var(--accent-bg); box-shadow: inset 5px 0 0 var(--brand); font-weight: 600; }
.mopt.on i { color: var(--brand); font-size: 20px; }
