:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f0eef8;
  --text: #17142b;
  --muted: #6a6684;
  --line: #e4e1f0;
  --primary: #5b4bff;
  --primary-ink: #ffffff;
  --primary-soft: #ebe8ff;
  --accent: #ffd23f;
  --ok: #12a46a;
  --ok-soft: #e1f6ec;
  --bad: #e5484d;
  --bad-soft: #fde8e8;
  --c-algebra: #5b4bff;
  --c-geometry: #0ea5a4;
  --c-physics: #f2711c;
  --c-history: #c2417a;
  --c-chemistry: #2f9e44;
  --c-english: #1c7ed6;
  --c-biology: #66a80f;
  --c-geography: #b45309;
  --c-informatics: #0b7285;
  --c-ukrainian: #c92a2a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 20, 43, .05), 0 8px 24px rgba(23, 20, 43, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #100e1c; --surface: #1a1729; --surface-2: #232036; --text: #f1effa; --muted: #a29fbb;
    --line: #2e2a45; --primary: #7d70ff; --primary-soft: #2a2550; --ok: #36c48a; --ok-soft: #173528;
    --bad: #ff6b70; --bad-soft: #3d1c22; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #100e1c; --surface: #1a1729; --surface-2: #232036; --text: #f1effa; --muted: #a29fbb;
  --line: #2e2a45; --primary: #7d70ff; --primary-soft: #2a2550; --ok: #36c48a; --ok-soft: #173528;
  --bad: #ff6b70; --bad-soft: #3d1c22; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
button, input { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { font-family: Unbounded, Manrope, sans-serif; font-weight: 800; font-size: 22px; color: var(--text); display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 10px -8px 0 -3px var(--accent); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: 10px; font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; vertical-align: middle; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 520px) { .nav a { padding: 8px 8px; font-size: 14px; } .nav .hide-sm { display: none; } }

.demo-banner { background: var(--accent); color: #2a2200; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 16px; }
.foot { color: var(--muted); font-size: 13px; padding-top: 16px; padding-bottom: 24px; text-align: center; }

/* common */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; cursor: pointer; background: var(--primary); color: var(--primary-ink); transition: transform .08s, filter .15s; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.white { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.big { padding: 16px 26px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 600; margin-bottom: 14px; font-size: 15px; }
.back:hover { color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.new { background: var(--primary-soft); color: var(--primary); }
.error { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.notice { background: var(--surface-2); padding: 12px 14px; border-radius: 12px; font-size: 14px; color: var(--muted); }
.loader { display: grid; place-items: center; padding: 80px 0; }
.loader span { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* hero */
.hero { display: grid; gap: 18px; grid-template-columns: 1.3fr 1fr; align-items: stretch; margin-bottom: 28px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.hero-main { background: var(--primary); color: #fff; border-radius: 24px; padding: 28px; position: relative; overflow: hidden; }
.hero-main h1 { color: #fff; }
.hero-main p { opacity: .9; margin: 0 0 18px; max-width: 46ch; }
.hero-main .btn { background: #fff; color: #2b2190; }
.hero-main::after { content: ""; position: absolute; right: -70px; top: -80px; width: 170px; height: 170px; border-radius: 50%; background: var(--accent); opacity: .9; }
.hero-main > * { position: relative; z-index: 1; }
.hero-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hero-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.hero-rules b { flex: none; white-space: nowrap; padding: 0 8px; font-family: Unbounded, sans-serif; font-size: 13px; min-width: 64px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.stat { background: rgba(255,255,255,.14); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 24px; font-family: Unbounded, sans-serif; }
.stat span { font-size: 12px; opacity: .85; }

/* subjects */
.subj { display: flex; flex-direction: column; gap: 12px; color: var(--text); transition: transform .12s, box-shadow .12s; }
.subj:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 14px 30px rgba(23,20,43,.1); }
.subj-head { display: flex; align-items: center; gap: 12px; }
.subj-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.subj-ico svg { width: 28px; height: 28px; }
.subj-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.c-algebra { --c: var(--c-algebra); } .c-geometry { --c: var(--c-geometry); } .c-physics { --c: var(--c-physics); } .c-history { --c: var(--c-history); }
.c-chemistry { --c: var(--c-chemistry); } .c-english { --c: var(--c-english); } .c-biology { --c: var(--c-biology); } .c-geography { --c: var(--c-geography); } .c-informatics { --c: var(--c-informatics); } .c-ukrainian { --c: var(--c-ukrainian); }
.subj-ico, .page-ico { background: var(--c, var(--primary)); }
.subj .progress > i { background: var(--c, var(--primary)); }

.page-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.page-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: none; }
.page-ico svg { width: 32px; height: 32px; }
.page-head h1 { margin: 0; }

/* tests list */
.tests { display: grid; gap: 10px; }
.test-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); }
.test-item:hover { border-color: var(--c, var(--primary)); }
.test-num { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 14px; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--c, var(--primary)); }
.test-body { flex: 1; min-width: 0; }
.test-body h3 { margin: 0 0 2px; }
.test-body p { margin: 0; color: var(--muted); font-size: 14px; }

/* theory */
.theory { font-size: 16.5px; line-height: 1.65; max-width: 72ch; margin-top: 18px; display: grid; gap: 14px; }
.theory p { margin: 0; }
.th-lead { font-size: 18px; font-weight: 600; padding: 14px 16px; border-radius: 14px; background: var(--primary-soft); border-left: 4px solid var(--primary); }
.th-h { font-size: 17px; font-weight: 800; color: var(--primary); margin: 8px 0 -4px; display: flex; align-items: center; gap: 10px; }
.th-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.th-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.th-list li { position: relative; padding: 8px 0 8px 26px; border-bottom: 1px dashed var(--line); }
.th-list li:last-child { border-bottom: 0; }
.th-list li::before { content: ""; position: absolute; left: 6px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .75; }
.th-terms { margin: 0; display: grid; gap: 8px; }
.th-terms > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 4px 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.th-terms dt { font-weight: 800; color: var(--primary); }
.th-terms dd { margin: 0; }
@media (max-width: 560px) { .th-terms > div { grid-template-columns: 1fr; } }
.th-formulas { display: flex; flex-wrap: wrap; gap: 8px; }
.th-f, .fx { font-family: "Manrope", system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.th-f { padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--primary); background: var(--surface); font-size: 17px; }
.fx { padding: 1px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--text); white-space: normal; }
.th-note, .th-ex { padding: 12px 16px; border-radius: 14px; display: grid; gap: 4px; }
.th-note { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent); }
.th-ex { background: var(--surface); border: 1.5px dashed var(--line); }
.th-note > b, .th-ex > b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.th-note > b { color: color-mix(in srgb, var(--text) 80%, var(--accent)); }
.th-ex > b { color: var(--c-geometry); }
.th-tl { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; position: relative; }
.th-tl li { display: grid; grid-template-columns: minmax(110px, 26%) 1fr; gap: 12px; padding: 8px 0 8px 22px; position: relative; }
.th-tl li::before { content: ""; position: absolute; left: 0; top: 15px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-history); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-history) 25%, transparent); }
.th-tl li::after { content: ""; position: absolute; left: 5px; top: 28px; bottom: -14px; width: 1.5px; background: var(--line); }
.th-tl li:last-child::after { display: none; }
.th-date { font-weight: 800; color: var(--c-history); }
@media (max-width: 560px) { .th-tl li { grid-template-columns: 1fr; gap: 0; } }
.th-fig { margin: 4px 0; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; justify-items: center; gap: 6px; }
.th-fig .dg { width: 100%; max-width: 360px; height: auto; }
.th-fig figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.rules-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.rules-box div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.rules-box b { display: block; color: var(--text); font-size: 18px; }

/* quiz */
.quiz { max-width: 640px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; color: var(--muted); font-size: 14px; }
.dots { display: flex; gap: 5px; margin-bottom: 14px; }
.dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.dots i.ok { background: var(--ok); } .dots i.bad { background: var(--bad); } .dots i.cur { background: var(--primary); }
.timer { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 22px; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--bad), var(--accent) 40%, var(--ok)); transform-origin: left; }
.timer i.run { animation: shrink linear forwards; }
@keyframes shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.question { font-size: clamp(21px, 4vw, 27px); font-weight: 800; margin: 0 0 22px; min-height: 2.4em; letter-spacing: -.01em; }
.options { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-size: 17px; font-weight: 600; transition: border-color .1s, background .1s; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt kbd { font: 700 13px Unbounded, sans-serif; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.timeout { text-align: center; color: var(--bad); font-weight: 700; margin-top: 12px; min-height: 1.5em; }

/* result */
.result { max-width: 640px; margin: 0 auto; text-align: center; }
.score-ring { width: 180px; height: 180px; margin: 10px auto 16px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .val { position: absolute; inset: 0; display: grid; place-content: center; font-family: Unbounded, sans-serif; }
.score-ring .val b { font-size: 46px; line-height: 1; }
.score-ring .val span { color: var(--muted); font-size: 14px; }
.review { text-align: left; margin-top: 24px; display: grid; gap: 8px; }
.review-item { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.review-item .q { font-weight: 700; }
.review-item .a { color: var(--muted); }
.review-item.ok { border-left: 4px solid var(--ok); }
.review-item.bad { border-left: 4px solid var(--bad); }

/* auth */
.auth { max-width: 420px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; text-align: center; font-size: 15px; }
.tabs .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 700; }
.field input { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; outline: none; }
.field input:focus { border-color: var(--primary); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn { background: var(--surface); color: var(--text); border: 1.5px solid var(--line); }
.gbtn svg { width: 20px; height: 20px; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; font-weight: 600; padding: 0; font-size: 14px; }

/* rating */
.board { width: 100%; border-collapse: collapse; }
.board th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 8px 10px; }
.board td { padding: 10px; border-top: 1px solid var(--line); }
.board td.num { font-family: Unbounded, sans-serif; font-weight: 800; width: 48px; }
.board td.avg { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.board th.avg, .board th.n, .board td.n { text-align: right; }
.board td.n { color: var(--muted); font-variant-numeric: tabular-nums; }
.board tr.me td { background: var(--primary-soft); }
.board tr.me td:first-child { border-radius: 10px 0 0 10px; } .board tr.me td:last-child { border-radius: 0 10px 10px 0; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #3a2b00; font-size: 13px; }
.m1 { background: #ffd23f; } .m2 { background: #d6d9e3; } .m3 { background: #f0b58a; }
.who { display: flex; align-items: center; gap: 10px; }

/* Код у теорії (інформатика) */
.th-code { margin: 0; padding: 12px 16px; border-radius: 12px; background: #1e1b2e; color: #ece9ff; overflow-x: auto;
  font: 500 14.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; border: 1px solid var(--line, transparent); }
.th-code code { font: inherit; }

/* Місячний топ і спонсори */
.month-banner { display: flex; align-items: center; gap: 14px; margin: -8px 0 26px; border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.month-banner:hover { transform: translateY(-1px); }
.mb-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #3a2b00; }
.mb-ico svg, .gift svg { width: 24px; height: 24px; }
.mb-text { display: grid; gap: 2px; min-width: 0; }
.mb-text span { color: var(--muted); font-size: 14px; }
.mb-go { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--muted); }
.sec-title { font-size: 19px; margin: 22px 0 12px; }
.prize-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.prize { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.prize > div { display: grid; gap: 3px; }
.prize b { font-size: 15px; line-height: 1.3; }
.prize.empty { background: transparent; box-shadow: none; border-style: dashed; }
.prize.empty b { color: var(--muted); font-weight: 600; }
.prize .medal { flex: none; }
.medal.m4 { background: var(--primary-soft); color: var(--primary); width: auto; min-width: 28px; padding: 0 6px; border-radius: 14px; }
.top-about { margin-top: 22px; }
.top-about h3 { margin: 4px 0 8px; }
.top-about p { margin: 0 0 14px; }
.top-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.top-rules li { display: flex; gap: 10px; align-items: flex-start; }
.top-rules b { flex: none; white-space: nowrap; padding: 0 6px; font-family: Unbounded, sans-serif; font-size: 12px; min-width: 34px; height: 28px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.login-cta { text-align: center; }
.board tr.prize-row td.num { color: var(--text); }
.gift { display: inline-grid; vertical-align: -4px; margin-left: 6px; color: var(--accent); }
.gift svg { width: 17px; height: 17px; }
.sponsors { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sponsor h2 { margin: 0; font-size: 20px; }
.sponsor p { margin: 12px 0; }
.sponsor-head { display: flex; gap: 14px; align-items: center; }
.sponsor-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--surface-2); flex: none; }
.sponsor-logo.txt { display: grid; place-items: center; font-family: Unbounded, sans-serif; font-weight: 800; font-size: 18px; color: #fff; background: var(--c-physics); }
.sp-list { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin-top: 8px; }
.sp-list b { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sp-list ul { margin: 6px 0 0; padding-left: 18px; }
.become { margin-top: 22px; }
.become h3 { margin-top: 4px; }
.foot a { color: inherit; }

/* Поширення результату */
.share-btn { background: var(--accent); color: #2b2190; }
.share-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 8, 25, .62); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.share-box { position: relative; width: min(440px, 100%); background: var(--surface); color: var(--text); border-radius: 22px; padding: 22px 20px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-height: calc(100dvh - 32px); overflow-y: auto; }
.share-box h2 { margin: 0 0 14px; font-size: 20px; }
.share-x { position: absolute; top: 10px; right: 12px; border: 0; background: var(--surface-2); color: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.share-prev { display: grid; place-items: center; min-height: 200px; margin-bottom: 14px; }
.share-prev img { width: auto; max-width: 100%; max-height: 42vh; border-radius: 14px; box-shadow: var(--shadow); }
.share-btns { display: grid; gap: 8px; }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sbtn { display: grid; place-items: center; padding: 11px 4px; border-radius: 12px; font-weight: 700; font-size: 14px; color: #fff; text-decoration: none; }
.s-fb { background: #1877f2; } .s-tg { background: #229ed9; } .s-vb { background: #7360f2; } .s-x { background: #111; }
.share-msg { color: var(--ok); text-align: center; min-height: 1em; }
.share-hint { margin: 12px 0 0; text-align: center; }
@media (max-width: 380px) { .share-row { grid-template-columns: repeat(2, 1fr); } }

/* Сторінка «Стати спонсором» */
.field select, .field textarea { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; outline: none; resize: vertical; }
.field input { color: var(--text); }
.field select:focus, .field textarea:focus { border-color: var(--primary); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pt-hero { position: relative; overflow: hidden; border-radius: 28px; padding: 44px 36px; color: #fff; background: linear-gradient(135deg, #6a5cff, #2f22b8); margin-bottom: 22px; }
.pt-hero::after { content: ""; position: absolute; right: -90px; top: -110px; width: 260px; height: 260px; border-radius: 50%; background: var(--accent); }
.pt-hero > * { position: relative; z-index: 1; }
.pt-hero h1 { color: #fff; font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; margin: 10px 0 14px; max-width: 18ch; }
.pt-hero p { max-width: 60ch; font-size: 17px; opacity: .92; margin: 0 0 22px; }
.pt-hero .btn { background: var(--accent); color: #2b2190; }
.pt-kicker { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; }
.pt-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pt-card h3 { margin: 12px 0 6px; }
.pt-card p { margin: 0; color: var(--muted); }
.pt-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.pt-ico svg { width: 24px; height: 24px; }
.pt-quote { margin: 30px auto; max-width: 30ch; text-align: center; font-family: Unbounded, sans-serif; font-weight: 800; font-size: clamp(20px, 3.2vw, 28px); line-height: 1.3; color: var(--primary); }
.pt-quote::before, .pt-quote::after { content: "«"; color: var(--accent); }
.pt-quote::after { content: "»"; }
.pt-two { display: grid; gap: 16px; grid-template-columns: 1fr 1.1fr; align-items: start; }
@media (max-width: 760px) { .pt-two { grid-template-columns: 1fr; } .pt-hero { padding: 32px 22px; } .pt-hero::after { width: 150px; height: 150px; right: -75px; top: -85px; } .pt-hero h1 { max-width: 15ch; } }
.pt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pt-list li { position: relative; padding-left: 30px; }
.pt-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.pt-form { position: relative; scroll-margin-top: 80px; }
.pt-thanks { text-align: center; padding: 20px 6px; }
.pt-thanks .pt-ico { margin: 0 auto; }
.pt-thanks p { color: var(--muted); }

/* Топи минулих місяців */
.arch-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; margin: 16px 0 4px; font-weight: 700; }
.arch-link b { color: var(--primary); font-size: 20px; }
.arch { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
.arch-side { position: sticky; top: 80px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); max-height: calc(100vh - 110px); overflow-y: auto; }
.arch-year { display: grid; gap: 2px; }
.arch-year > span { font-family: Unbounded, sans-serif; font-weight: 800; font-size: 13px; color: var(--muted); padding: 4px 10px; }
.arch-side a { display: block; padding: 9px 12px; border-radius: 10px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.arch-side a:hover { background: var(--surface-2); }
.arch-side a.on { background: var(--primary); color: #fff; }
.arch-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.arch-prize { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin-bottom: 14px; }
.pod { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod > span:not(.avatar) { font-size: 12px; color: var(--muted); }
.pod .avatar { width: 46px; height: 46px; font-size: 16px; }
.pod-step { width: 100%; display: grid; place-items: start center; padding-top: 10px; border-radius: 14px 14px 0 0; background: var(--primary-soft); }
.pod-1 .pod-step { height: 96px; background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.pod-2 .pod-step { height: 70px; }
.pod-3 .pod-step { height: 52px; }
@media (max-width: 760px) {
  .arch { grid-template-columns: 1fr; gap: 12px; }
  .arch-side { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 6px; max-height: none; }
  .arch-year { display: flex; align-items: center; gap: 4px; }
  .arch-year > span { padding: 0 6px; }
}

/* Розділ «Для розвитку» */
.extra-head { display: grid; gap: 4px; margin: 30px 0 12px; }
:root { --c-rhetoric: #9c36b5; }
.c-rhetoric { --c: var(--c-rhetoric); }
:root { --c-tacmed: #e03131; --c-fpv: #1c7ed6; }
.c-tacmed { --c: var(--c-tacmed); }
.c-fpv { --c: var(--c-fpv); }
:root { --c-kb: #0ca678; --c-nmtalgebra: #e8590c; }
.c-nmtalgebra { --c: var(--c-nmtalgebra); }
.c-kb { --c: var(--c-kb); }
.c-ukrainian11 { --c: var(--c-ukrainian); } .c-algebra11 { --c: var(--c-algebra); } .c-geometry11 { --c: var(--c-geometry); } .c-physics11 { --c: var(--c-physics); }
.c-history11 { --c: var(--c-history); } .c-chemistry11 { --c: var(--c-chemistry); } .c-biology11 { --c: var(--c-biology); } .c-geography11 { --c: var(--c-geography); } .c-english11 { --c: var(--c-english); } .c-informatics11 { --c: var(--c-informatics); }

/* Вибір класу в шапці */
.grade-sw { margin-right: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.grade-sw button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.grade-sw button.on { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.grade-tabs { max-width: 320px; }
@media (max-width: 520px) {
  .logo { font-size: 19px; }
  .grade-sw button { padding: 6px 9px; font-size: 13px; }
  .nav a { padding: 8px 8px; }
  .grade-sw .hide-sm { display: none; }
}

/* ── Про нас, підписка, документи ── */
.info-hero { padding: 26px 0 18px; display: grid; gap: 12px; }
.info-hero h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.info-hero p { margin: 0; font-size: 17px; color: var(--muted); max-width: 760px; }
.req { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 6px 0 0; }
.req dt { color: var(--muted); font-size: 14px; }
.req dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
mark.todo { background: #ffe066; color: #5c3c00; padding: 0 4px; border-radius: 4px; }
.doc-links { margin: 14px 0 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.shots figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.shots img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.shots figcaption { padding: 10px 14px; font-size: 14px; font-weight: 600; }
.plan-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan { border: 2px solid var(--primary); }
.plan-name { font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.plan-price { margin: 6px 0 12px; }
.plan-price b { font-family: Unbounded, Manrope, sans-serif; font-size: 48px; }
.plan-price span { color: var(--muted); font-weight: 600; }
.steps { padding-left: 20px; display: grid; gap: 6px; }
.legal { max-width: 860px; margin: 10px auto; line-height: 1.6; }
.legal h1 { margin-top: 4px; font-size: clamp(24px, 3.4vw, 32px); }
.legal h2 { font-size: 19px; margin: 22px 0 6px; }
.legal p { margin: 8px 0; }
@media (max-width: 760px) { .plan-wrap { grid-template-columns: 1fr; } .req { grid-template-columns: 1fr; gap: 2px; } .req dd { margin-bottom: 8px; } }

/* завдання НМТ у теорії */
.th-task, .th-ans { padding: 12px 16px; border-radius: 14px; display: grid; gap: 4px; }
.th-task { background: var(--surface-2); border-left: 4px solid var(--c-nmtalgebra, var(--primary)); }
.th-task p { font-size: 17px; font-weight: 600; margin: 0; }
.th-ans { background: var(--ok-soft); border: 1.5px solid color-mix(in srgb, var(--ok) 55%, transparent); }
.th-task > b, .th-ans > b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.th-task > b { color: var(--c-nmtalgebra, var(--primary)); }
.th-ans > b { color: var(--ok); }
.th-ans p { margin: 0; font-weight: 700; }
.th-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.th-opts li { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; }
