:root {
  --blue: #0b55d9;
  --blue-d: #0a43ad;
  --blue-l: #e6efff;
  --navy: #0b1f5b;
  --text: #24304d;
  --muted: #6b7896;
  --line: #dde6f5;
  --bg: #f3f7ff;
  --card: #fff;
  --red: #e5352b;
  --green: #2e9e5b;
  --gold: #f5a623;
  --r: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg) linear-gradient(180deg, #eaf2ff 0, var(--bg) 420px) no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; padding-top: 28px; padding-bottom: 40px; }
.wrap.narrow.sm { max-width: 460px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.25em; }

/* шапка */
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo b { display: block; font-size: 24px; letter-spacing: .5px; color: var(--navy); line-height: 1; }
.logo i { font-style: normal; color: var(--blue); }
.logo small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: 24px; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--blue-l); color: var(--blue); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang { text-decoration: none; font-weight: 600; font-size: 14px; }
.notice { background: #fff6dd; border-bottom: 1px solid #f3dfa3; padding: 10px 0; font-size: 15px; }
.notice a { font-weight: 600; }
.foot { padding: 24px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 20px; border: 1.5px solid var(--blue); border-radius: 10px;
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-l); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #c42a21; border-color: #c42a21; }
.btn.lg { padding: 15px 26px; font-size: 17px; border-radius: 12px; }
.btn.sm { padding: 8px 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; }
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 6px 24px rgba(20, 60, 140, .07); }

/* главная */
.hero .wrap { position: relative; display: flex; align-items: center; min-height: 356px; }
.hero-text { position: relative; z-index: 1; max-width: 600px; padding: 32px 0; }
.hero h1 { font-size: clamp(30px, 5vw, 54px); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--blue); display: block; }
.hero p { font-size: clamp(17px, 2.4vw, 22px); margin: 14px 0 26px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-img {
  /* Размер картинки не зависит от высоты блока: при длинном заголовке она не растягивается и не мутнеет */
  position: absolute; right: 0; bottom: 0; width: min(70%, 880px); height: auto;
  border-radius: 0 0 var(--r) var(--r);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%), linear-gradient(180deg, transparent, #000 16%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 28%), linear-gradient(180deg, transparent, #000 16%);
  mask-composite: intersect;
}

.hero p { max-width: 500px; }

/* формулы в вопросах */
.math { font-family: "Cambria Math", Cambria, "Times New Roman", serif; font-size: 1.08em; white-space: nowrap; }
.math sup, .math sub { font-size: .72em; line-height: 0; }
.frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; font-size: .88em; line-height: 1.15; margin: 0 3px; }
.frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 4px 1px; }
.frac > span:last-child { padding: 1px 4px 0; }
.sqrt > span { border-top: 1.5px solid currentColor; padding: 0 2px; }
.q-img { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; margin: 0 0 16px; }

/* разбор ответов */
.review { display: grid; gap: 12px; }
.review h1 { font-size: clamp(24px, 4vw, 30px); }
.rv { padding: 18px 20px; border-left: 5px solid var(--line); }
.rv.ok { border-left-color: var(--green); }
.rv.bad { border-left-color: var(--red); }
.rv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rv h2 { font-size: 18px; margin-bottom: 12px; white-space: pre-wrap; }
.chip.ok { background: #dff5e6; color: #1d6b3c; }
.chip.bad { background: #ffe1de; color: #a3231b; }
.chip.none { background: #e9edf5; color: var(--muted); }
.rv-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-opts li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; }
.rv-opts small { font-size: 12px; font-weight: 600; white-space: nowrap; }
.rv-opts .right { border-color: var(--green); background: #eefaf2; }
.rv-opts .right small { color: #1d6b3c; }
.rv-opts .wrong { border-color: var(--red); background: #fff1ef; }
.rv-opts .wrong small { color: #a3231b; }

/* дипломы */
.award { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 16px; border-radius: 20px; font-weight: 700; }
.award.deg1, .cert-mini.deg1 { background: #fff1c9; color: #8a5a00; }
.award.deg2, .cert-mini.deg2 { background: #e6ebf3; color: #45556e; }
.award.deg3, .cert-mini.deg3 { background: #f7dfcb; color: #84451a; }
.cert-mini b { font: 700 34px Georgia, serif; }

/* справочные страницы */
.doc h3 { margin: 24px 0 8px; }
.doc p { margin: 0 0 10px; }
.faq { margin: 16px 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font-weight: 600; color: var(--navy); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--blue); transform: rotate(90deg); transition: transform .15s; }
.faq details[open] summary .ic { transform: rotate(-90deg); }
.faq details p { margin: 0 0 14px; color: var(--text); }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 10px; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--blue); }

/* раздел учителя */
.teacher { max-width: 1100px; display: grid; gap: 14px; padding-top: 18px; padding-bottom: 36px; }
.teacher > * { min-width: 0; }
.t-head > div { min-width: 0; }
.t-head h1 { overflow-wrap: anywhere; }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.t-head h1 { margin-bottom: 2px; }
.t-list { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; margin: 10px 0 14px; outline: none; resize: vertical; }
.t-list:focus { border-color: var(--blue); }
.t-grade { max-width: 320px; }
.t-how { margin-top: 14px; font-size: 14px; }
.t-csv { margin-left: auto; }
.t-res { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* нижняя панель: видна только на телефоне */
.tabbar { display: none; }
.m-school { display: none; }
.logo small { white-space: nowrap; }
.user span:last-child { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err + .btn { margin-top: 14px; }

/* результаты в кабинете */
.res-row { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid #eef2fa; }
.res-row:last-child { border-bottom: 0; }
.res-main { flex: 1; min-width: 150px; }
.res-main b { display: block; color: var(--navy); font-size: 17px; }
.res-main small, .res-score small { color: var(--muted); font-size: 13px; }
.res-score { text-align: center; min-width: 70px; }
.res-score b { display: block; color: var(--navy); font-size: 18px; white-space: nowrap; }
.feats { list-style: none; margin: -18px 0 0; padding: 16px 20px; position: relative; z-index: 2; background: #fff; border-radius: var(--r); box-shadow: 0 6px 24px rgba(20, 60, 140, .08); display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.feats li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; line-height: 1.25; }
.feats .ic { width: 30px; height: 30px; color: var(--blue); }
.feats li:first-child .ic, .feats li:nth-child(4) .ic { color: var(--gold); }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.subj { display: flex; align-items: center; gap: 18px; min-height: 132px; padding-right: 20px; border-radius: var(--r); overflow: hidden; background: #eaf2ff; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.subj:nth-child(odd) { background: #ffeeee; }
.subj:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20, 60, 140, .14); }
.subj img { width: 42%; max-width: 250px; height: 132px; object-fit: cover; }
.subj:not(:has(img)) { padding-left: 24px; }
.subj-t { flex: 1; }
.subj-t b { display: block; font-size: 24px; color: var(--navy); }
.subj-t small { color: var(--muted); font-size: 14px; }
.round { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--blue); flex: none; }
.grades { display: flex; align-items: center; gap: 24px; padding: 20px 24px; flex-wrap: wrap; }
.grades h2 { font-size: 22px; }
.grades p { color: var(--muted); font-size: 14px; }
.grade-row { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: flex-end; }
.grade-row a { width: 68px; padding: 10px 0; border: 1px solid var(--line); border-radius: 12px; text-align: center; text-decoration: none; color: var(--navy); }
.grade-row a:hover { border-color: var(--blue); background: var(--blue-l); }
.grade-row b { display: block; font-size: 22px; line-height: 1.1; }
.grade-row small { color: var(--muted); font-size: 11px; }
.how { padding: 44px 0 48px; }
.how h2 { text-align: center; font-size: 28px; margin-bottom: 24px; }
.steps { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { background: #fff; border-radius: var(--r); padding: 20px; box-shadow: 0 6px 24px rgba(20, 60, 140, .06); }
.steps b { display: block; color: var(--navy); font-size: 17px; margin: 12px 0 4px; }
.steps p { color: var(--muted); font-size: 14px; }
.num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; }

/* формы */
.form { padding: 28px clamp(18px, 5vw, 44px) 32px; }
.form h1 { font-size: clamp(24px, 4vw, 32px); margin: 10px 0 6px; }
.form h3 { font-size: 19px; margin: 26px 0 12px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--blue); }
.f { display: block; margin-bottom: 16px; }
.f > span { display: block; font-weight: 500; margin-bottom: 6px; }
.f i { color: var(--red); font-style: normal; }
.f small { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
input, select, textarea { font: inherit; color: inherit; }
.f input, .f select, .code, .admin input:not([type=checkbox]), .admin select, .admin textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; outline: none;
}
.f input:focus, .f select:focus, .code:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 85, 217, .13); }
.f .bad { border-color: var(--red); }
.err { color: var(--red); font-size: 13px; margin-top: 5px; }
.alert { background: #ffecea; color: #a3231b; border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.alert.dev { background: #fff6dd; color: #6d5200; }
.alert.ok { background: #e7f6ec; color: #1d6b3c; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 14px; border-radius: 12px; border: 1.5px solid transparent; background: #f1f4fa; font-weight: 700; cursor: pointer; }
.seg input:checked + span { background: var(--blue-l); border-color: var(--blue); color: var(--blue); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(11, 85, 217, .2); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 20px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.code { text-align: center; font-size: 34px; font-weight: 700; letter-spacing: 14px; padding-left: 28px; margin: 18px 0 14px; }
.resend { margin: 18px 0; font-size: 15px; }

/* информация об олимпиаде */
.info-head { display: flex; gap: 18px; align-items: center; }
.info-head img { width: 140px; height: 96px; object-fit: cover; border-radius: 12px; }
.facts { margin: 22px 0; display: grid; gap: 10px; }
.facts div { display: flex; align-items: center; gap: 10px; }
.facts dt { color: var(--muted); min-width: 190px; }
.facts dd { margin: 0; font-weight: 600; color: var(--navy); }
.facts .ic { color: var(--blue); }
.note { background: var(--bg); border-radius: 12px; padding: 16px 18px; margin-bottom: 22px; font-size: 15px; }
.note ul { margin: 8px 0 0; padding-left: 20px; }

/* тест */
.test { max-width: 900px; padding-top: 18px; padding-bottom: 40px; }
.test-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 14px; }
.timer { color: var(--red); font-size: 26px; display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dots button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.dots .done { background: var(--green); border-color: var(--green); color: #fff; }
.dots .cur { background: var(--blue); border-color: var(--blue); color: #fff; }
.test-main { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; margin-bottom: 20px; }
.legend { list-style: none; margin: 0; padding: 16px; background: var(--blue-l); border-radius: 12px; font-size: 13px; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.d { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #b9c6dd; background: #fff; flex: none; }
.d.done { background: var(--green); border-color: var(--green); }
.d.cur { background: var(--blue); border-color: var(--blue); }
.q { padding: 24px; }
.q h2 { font-size: 20px; margin: 8px 0 18px; white-space: pre-wrap; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: #b3c6ea; }
.opt input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.opt.sel { background: var(--blue-l); border-color: var(--blue); }
.q-btns { display: flex; gap: 12px; margin-top: 22px; }
.q-btns .btn { flex: 1; }
.modal { position: fixed; inset: 0; background: rgba(20, 30, 60, .6); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal .card { max-width: 440px; width: 100%; padding: 28px; }
.modal h2 { font-size: 21px; margin: 12px 0 8px; }
.warn .ic { width: 52px; height: 52px; color: #ff7a1a; }

/* результат */
.cup .ic { width: 56px; height: 56px; color: var(--gold); }
.result h1 { color: var(--blue); }
.res-box { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; background: var(--bg); border-radius: var(--r); padding: 22px; margin: 22px 0; text-align: left; }
.ring-bg { fill: none; stroke: #dbe6f7; stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 10; stroke-linecap: round; }
.ring-n { font-size: 20px; font-weight: 800; fill: var(--navy); }
.ring-l { font-size: 11px; fill: var(--muted); }
.res-info b { font-size: 18px; color: var(--navy); }
.res-info dl { margin: 12px 0 0; display: grid; gap: 4px; font-size: 15px; }
.res-info dl div { display: flex; gap: 12px; }
.res-info dt { color: var(--muted); min-width: 150px; }
.res-info dd { margin: 0; font-weight: 600; }

.res-btns { justify-content: center; }

/* рейтинг */
.rating { padding-top: 28px; padding-bottom: 40px; max-width: 980px; }
.rating h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 18px; }
.rt-filters { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: 10px; padding: 14px; margin-bottom: 16px; }
.rt-filters select, .rt-filters input { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; outline: none; }
.rt-filters select:focus, .rt-filters input:focus { border-color: var(--blue); }
.rt-table { overflow-x: auto; }
.rt-table table { width: 100%; border-collapse: collapse; }
.rt-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rt-table td { padding: 12px 16px; border-bottom: 1px solid #eef2fa; }
.rt-table tr:last-child td { border-bottom: 0; }
.rt-table .me td { background: var(--blue-l); font-weight: 600; }
.rt-table .gap td { text-align: center; color: var(--muted); padding: 4px; }
.place { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; font-weight: 700; color: var(--navy); }
.place.m1 { background: #ffd24a; }
.place.m2 { background: #cfd8e6; }
.place.m3 { background: #e9a56b; }
.rt-note { font-size: 13px; margin-top: 12px; }

/* вход и регистрация */
.user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 600; }
.ava { display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; background: linear-gradient(135deg, #cfe0ff, #8fb4ff); color: var(--navy); font-size: 44px; font-weight: 700; flex: none; }
.ava.sm { width: 38px; height: 38px; font-size: 14px; }
.ava.md { width: 64px; height: 64px; font-size: 22px; }
img.ava { display: block; object-fit: cover; background: #dbe6f7; }

/* проверка сертификата */
.verif-ic .ic { width: 72px; height: 72px; }
.verif.ok .verif-ic, .verif.ok h1 { color: var(--green); }
.verif.bad .verif-ic, .verif.bad h1 { color: var(--red); }
.verif-dl { margin: 22px 0; text-align: left; background: var(--bg); border-radius: var(--r); padding: 8px 20px; }
.verif-dl div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.verif-dl div:last-child { border-bottom: 0; }
.verif-dl dt { color: var(--muted); min-width: 170px; }
.verif-dl dd { margin: 0; font-weight: 600; color: var(--navy); }
.tabs { margin-bottom: 22px; }
.tabs a { display: block; text-align: center; padding: 13px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 600; text-decoration: none; color: var(--text); }
.tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.alt { margin-top: 18px; }
.btn.soft { background: var(--blue-l); border-color: var(--blue-l); color: var(--blue); }
.btn.soft:hover { background: #d6e4ff; border-color: #d6e4ff; }
p.note { margin: 4px 0 20px; }
.phones { margin: 4px 0 20px; line-height: 1.8; }

/* личный кабинет */
.cab { display: grid; grid-template-columns: 230px 1fr; gap: 20px; max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; align-items: start; }
.side { display: grid; gap: 4px; position: sticky; top: 18px; }
.side a, .side button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; border-radius: 12px; background: none; font: inherit; font-weight: 500; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; }
.side a:hover, .side button:hover { background: #e9f0ff; }
.side a.on { background: var(--blue-l); color: var(--blue); font-weight: 700; }
.side .ic { width: 22px; height: 22px; }
.cab-main { display: grid; gap: 16px; min-width: 0; }
.pad { padding: 22px; }
.pad h1 { font-size: 24px; margin-bottom: 16px; }
.pad h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.count { font-size: 13px; font-weight: 600; color: var(--blue); background: var(--blue-l); padding: 3px 10px; border-radius: 20px; }
.empty { padding: 18px 0; }
.prof { display: flex; gap: 26px; padding: 24px; align-items: center; flex-wrap: wrap; }
.prof-info { flex: 1; min-width: 220px; }
.prof-info h1 { font-size: 26px; margin-bottom: 8px; }
.prof-info dl { margin: 14px 0 0; display: grid; gap: 8px; }
.prof-info dl div { display: flex; align-items: center; gap: 10px; }
.prof-info dt { color: var(--muted); min-width: 80px; }
.prof-info dd { margin: 0; font-weight: 600; color: var(--navy); }
.prof-info .ic { color: var(--navy); }
.prof-r { display: grid; gap: 12px; justify-items: end; }
.ach { background: var(--bg); border-radius: 14px; padding: 14px; }
.ach-h { display: flex; align-items: center; gap: 8px; color: var(--navy); margin-bottom: 10px; }
.ach-h .ic { color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(3, 118px); gap: 10px; }
.tile { border-radius: 12px; padding: 12px 8px; text-align: center; text-decoration: none; }
.tile b { display: block; font-size: 26px; line-height: 1.1; }
.tile small { display: block; font-size: 12px; line-height: 1.25; margin-top: 4px; color: var(--text); }
.t1 { background: #dcecff; } .t1 b { color: var(--blue); }
.t2 { background: #dff5e6; } .t2 b { color: var(--green); }
.t3 { background: #ebe3ff; } .t3 b { color: #6a35c9; }
.cols { display: grid; grid-template-columns: 1.9fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.grp { font-size: 22px; margin-top: 28px; }
.grp + p { margin-top: 10px; }
.subj.past { filter: grayscale(.7); opacity: .85; }
/* лента конкурсов */
.feed h1 { margin-bottom: 18px; }
.feed article { overflow: hidden; margin-bottom: 18px; }
.feed article img { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.feed h2 { font-size: 21px; margin: 6px 0 10px; }
.feed .note { margin: 14px 0 0; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 8px; }
.chip.open { background: #dcecff; color: var(--blue); }
.chip.grey { background: #e9edf5; color: var(--muted); }
.ct { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.tone0 { background: #ffecec; } .tone0 .chip.open { background: #ffd9d9; color: #c0392b; }
.tone1 { background: #e8f1ff; } .tone1 .chip.open { background: #d3f0dd; color: #1f8048; }
.tone2 { background: #fff4df; } .tone2 .chip.open { background: #ffe4b3; color: #a86400; }
.ct img { width: 86px; height: 80px; object-fit: cover; border-radius: 10px; flex: none; }
.ct-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: #e3edff; color: var(--blue); flex: none; }
.ct-ic .ic { width: 28px; height: 28px; }
.ct-b { flex: 1; min-width: 150px; }
.ct-b b { display: block; color: var(--navy); margin: 4px 0; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 15px; height: 15px; }
.ct-left { text-align: center; background: rgba(255, 255, 255, .6); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); }
.ct-left .ic { display: none; }
.ct-left small { display: block; max-width: 110px; line-height: 1.2; }
.ct-left b { display: block; font-size: 18px; color: var(--red); }
.ct-done { display: flex; align-items: center; gap: 12px; }
.ct-done b { font-size: 18px; color: var(--navy); white-space: nowrap; }
.up { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef2fa; }
.up:last-child { border-bottom: 0; }
.acts { display: flex; align-items: center; gap: 14px; justify-content: flex-end; white-space: nowrap; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cert-card { display: grid; gap: 6px; justify-items: start; padding: 18px; border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); }
.cert-card:hover { border-color: var(--blue); }
.cert-card b { color: var(--navy); font-size: 17px; }
.cert-card small { color: var(--muted); margin-bottom: 8px; }
.cert-mini { display: grid; place-items: center; width: 100%; height: 96px; border-radius: 10px; background: linear-gradient(135deg, #0b3aa5 0 22%, #fff 22% 78%, #0b3aa5 78%); border: 2px solid var(--gold); color: var(--gold); margin-bottom: 6px; }
.cert-mini .ic { width: 40px; height: 40px; }

/* сертификат */
.cert-page { max-width: 1000px; padding-top: 22px; padding-bottom: 40px; }
.cert-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cert-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cert { background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(20, 60, 140, .16); overflow: hidden; line-height: 0; }
.cert svg { width: 100%; height: auto; }
@page { size: A4 landscape; margin: 0; }
@media print {
  .top, .foot, .cert-bar, .notice { display: none !important; }
  body { background: #fff; }
  .cert-page { max-width: none; padding: 0; }
  .cert { box-shadow: none; border-radius: 0; }
  .cert svg { width: 100vw; height: 100vh; }
}

/* админка */
.admin .wrap { max-width: 1280px; padding-top: 24px; padding-bottom: 40px; }
.admin section { padding: 20px; margin-top: 18px; }
.admin h2 { margin-bottom: 12px; }
.admin h3 { margin: 18px 0 8px; }
.admin table { border-collapse: collapse; width: 100%; font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin input:not([type=checkbox]), .admin select { padding: 7px 9px; }
.admin textarea { margin: 10px 0; font-family: Consolas, monospace; font-size: 13px; }
.admin code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.filters select { width: auto; }
.admin .filters input:not([type=checkbox]) { width: 320px; max-width: 100%; }
.a-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.a-nav a { padding: 9px 16px; border-radius: 10px; background: #fff; text-decoration: none; font-weight: 600; color: var(--text); }
.a-nav a.on { background: var(--blue); color: #fff; }
.a-nav .out { margin-left: auto; background: none; color: var(--blue); }
.admin p.muted { margin-bottom: 10px; font-size: 14px; }
.a-acts form { display: inline-block; margin-right: 10px; }
.right { color: var(--green); }
.q-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.q-form label select, .q-form label textarea { margin-top: 4px; font-weight: 400; }
.q-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.q-opt input[type=radio] { width: 18px; height: 18px; flex: none; accent-color: var(--green); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.theme-grid figure { margin: 0; }
.theme-grid figcaption { margin-top: 8px; font-size: 14px; }
.q-thumb { max-width: 160px; max-height: 90px; border-radius: 6px; margin-top: 6px; }
.q-preview { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.q-form input[type=file] { display: block; margin-top: 4px; font-weight: 400; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 16px; }
.set-grid.three { grid-template-columns: repeat(3, minmax(0, 200px)); }
.set-grid label, .admin section > form > label, .admin form > section > label { display: block; font-size: 14px; font-weight: 600; }
.set-grid input, .admin section label select { margin-top: 4px; font-weight: 400; }
.scroll { overflow-x: auto; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .logo small { display: none; }
  .top .wrap { min-height: 56px; }
  .user span:last-child { display: none; }

  /* нижняя панель навигации под большой палец */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; min-width: 0; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .ic { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--blue); }
  .has-tabs { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .foot { padding: 16px 0 20px; font-size: 13px; }

  /* главная: картинка — отдельным баннером над заголовком, а не фоном под текстом */
  .hero .wrap { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero-img { position: static; order: -1; width: 100%; margin-top: 14px; border-radius: var(--r); -webkit-mask-image: none; mask-image: none; }
  .hero-text { max-width: none; padding: 18px 0 8px; }
  .hero p { margin: 8px 0 18px; }
  .feats { grid-template-columns: 1fr 1fr; margin-top: 14px; padding: 14px; gap: 10px; }
  .feats li { font-size: 13px; gap: 8px; }
  .feats .ic { width: 24px; height: 24px; }
  .feats li:last-child { display: none; }
  .grades { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .grade-row { justify-content: flex-start; }
  .grade-row a { width: calc(20% - 7px); min-width: 54px; }
  .how { padding: 28px 0 24px; }
  .how h2 { font-size: 22px; margin-bottom: 14px; }
  .steps { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; padding: 14px; }
  .steps .num { grid-row: 1 / 3; }
  .steps b { margin: 0 0 2px; font-size: 16px; }

  /* тест: таймер всегда на виду, номера вопросов — одной прокручиваемой строкой */
  .test-main { grid-template-columns: 1fr; }
  .legend { display: none; }
  .test-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 0 -16px 10px; padding: 8px 16px; box-shadow: 0 1px 0 var(--line); }
  .timer { font-size: 22px; }
  .dots { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: none; }
  .dots::-webkit-scrollbar { display: none; }
  .dots button { flex: none; }

  /* кабинет */
  .cab { grid-template-columns: 1fr; gap: 12px; padding: 12px 16px 24px; }
  .side { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side a, .side button { width: auto; white-space: nowrap; padding: 8px 12px; background: #fff; font-size: 14px; gap: 8px; }
  .side .ic { width: 18px; height: 18px; }
  .side form { flex: none; }
  .side .wide-only { display: none; }
  .cab-main { gap: 12px; }
  .cols { grid-template-columns: 1fr; gap: 12px; }
  .prof { display: grid; grid-template-columns: auto 1fr; gap: 14px 16px; padding: 16px; align-items: start; }
  .prof-info { min-width: 0; }
  .prof-info h1 { font-size: 20px; overflow-wrap: anywhere; }
  .prof-info dl { gap: 4px; margin-top: 10px; font-size: 14px; }
  .prof-info dl div { align-items: flex-start; gap: 8px; }
  .prof-info dt { display: none; }
  .prof-info .ic { margin-top: 2px; }
  .prof-r { grid-column: 1 / -1; justify-items: stretch; }
  .ach { padding: 12px; }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile b { font-size: 22px; }
  .ava:not(.sm):not(.md) { width: 76px; height: 76px; font-size: 26px; }
  .pad { padding: 16px; }
  .pad h1 { font-size: 21px; margin-bottom: 10px; }
  .pad h2 { font-size: 18px; margin-bottom: 12px; }
  .ct { padding: 10px; gap: 10px 12px; }
  .ct img { width: 68px; height: 64px; }
  .ct-b { min-width: 0; flex: 1 1 60%; }
  .ct-b b { font-size: 15px; }
  .ct > .btn, .ct-done { flex: 1 1 auto; justify-content: space-between; }
  .ct-left { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
  .ct-left small { max-width: none; }
  .ct-left b { font-size: 15px; }
  .res-row .acts { flex: 1 1 100%; justify-content: stretch; flex-wrap: wrap; gap: 8px; white-space: normal; }
  .res-row .acts .btn { flex: 1 1 40%; }
  .res-row .acts .btn:last-child { flex-basis: 100%; }
  /* учитель: телефоны учеников на узком экране скрыты, остаются имя, класс и результаты */
  .teacher .rt-table th:nth-child(3), .teacher .rt-table td:nth-child(3),
  .teacher .rt-table th:nth-child(4), .teacher .rt-table td:nth-child(4) { display: none; }
  .t-res { white-space: normal; }
  .t-csv { margin-left: 0; }
  .pad h2 { flex-wrap: wrap; }
  .rv { padding: 14px; }
  .rv-opts li { flex-wrap: wrap; }
  .set-grid.three { grid-template-columns: 1fr; }
  .verif-dl dt { min-width: 120px; }
}

/* ---------- телефон ---------- */
@media (max-width: 560px) {
  .wrap.narrow { padding-top: 14px; padding-bottom: 24px; }
  .form { padding: 20px 16px 22px; }
  .form h3 { margin: 20px 0 10px; font-size: 17px; }
  .row2 { grid-template-columns: 1fr; }
  .btn.lg { padding: 14px 18px; font-size: 16px; }
  .hero-btns .btn { flex: 1 1 100%; }
  .seg span { padding: 12px 6px; font-size: 14px; }
  .code { font-size: 30px; letter-spacing: 10px; padding-left: 22px; }
  .logo b { font-size: 20px; }
  .logo img { width: 34px; height: 34px; }
  .subjects { grid-template-columns: 1fr; gap: 10px; margin: 14px 0; }
  .subj { min-height: 96px; gap: 12px; padding-right: 12px; }
  .subj img { width: 34%; height: 96px; }
  .subj-t b { font-size: 18px; line-height: 1.2; }
  .round { width: 36px; height: 36px; }
  .info-head img { width: 92px; height: 68px; }
  .info-head h1 { font-size: 22px; }
  .facts dt { min-width: 0; flex: 1; }
  .q { padding: 16px; }
  .q h2 { font-size: 18px; margin-bottom: 14px; }
  .opt { padding: 14px; }
  .dots button { width: 34px; height: 34px; font-size: 13px; }
  .modal .card { padding: 22px 18px; }
  .res-box { gap: 14px; padding: 16px; }
  .res-info dt { min-width: 120px; }
  .res-btns .btn { flex: 1 1 100%; }
  .rating { padding-top: 16px; }
  .rt-filters { grid-template-columns: 1fr 1fr; padding: 12px; }
  .rt-filters input, .rt-filters .btn { grid-column: 1 / -1; }
  .rt-table th, .rt-table td { padding: 10px 8px; font-size: 14px; }
  /* рейтинг на телефоне: школа — мелкой строкой под именем, время скрыто */
  .rating .rt-table th:nth-child(3), .rating .rt-table td:nth-child(3),
  .rating .rt-table th:nth-child(5), .rating .rt-table td:nth-child(5) { display: none; }
  .m-school { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; margin-top: 2px; }
  .hero p { max-width: none; }
  .cert-page { padding-top: 14px; }
  .cert-btns { width: 100%; }
  .cert-btns .btn { flex: 1; padding: 11px 10px; font-size: 14px; }
  .cert-grid { grid-template-columns: 1fr; }
  .verif-dl { padding: 4px 14px; }
  .verif-dl div { flex-direction: column; gap: 0; padding: 8px 0; }
}
