/* ───────────── шрифты: Inter — текст, Manrope — заголовки ───────────── */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/fonts/inter-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/vendor/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/vendor/fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ───────────── токены ───────────── */
:root {
  --bg: #0b0c10;
  --surface: #15161c;
  --surface-2: #1d1e26;
  --surface-3: #282a33;
  --press: #22232b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f2f3f7;
  --text-2: #b3b6c2;
  --text-3: #7d8191;
  --accent: #8d7ff7;
  --accent-2: #5fb8ff;
  --accent-soft: rgba(141, 127, 247, 0.16);
  --accent-ink: #ffffff;
  --ok: #3fd391;
  --warn: #f5b942;
  --danger: #ff6b6b;
  --c-toe: #9d8cff;
  --c-ei: #3cc8e6;
  --c-elmash: #ff9a52;
  --c-eo: #4fd486;
  --figure-bg: #ffffff;
  --bar-bg: rgba(20, 21, 27, 0.9);
  --bar-line: rgba(255, 255, 255, 0.09);
  --bar-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.75), 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-shadow: none;

  --r-card: 20px;
  --r-md: 16px;
  --safe-t: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --bar-h: 68px;
  --fs: 1;
  --tint: var(--accent);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-d: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --surface-3: #e5e6ec;
  --press: #ecedf2;
  --line: rgba(16, 18, 40, 0.07);
  --line-2: rgba(16, 18, 40, 0.12);
  --text: #111218;
  --text-2: #4b4e5b;
  --text-3: #8a8d99;
  --accent: #5b4ef0;
  --accent-2: #1a8fe0;
  --accent-soft: rgba(91, 78, 240, 0.1);
  --ok: #10a464;
  --warn: #c58300;
  --danger: #e04848;
  --c-toe: #6a5af9;
  --c-ei: #0a95b8;
  --c-elmash: #e2700f;
  --c-eo: #129e57;
  --bar-bg: rgba(255, 255, 255, 0.92);
  --bar-line: rgba(16, 18, 40, 0.08);
  --bar-shadow: 0 12px 30px -14px rgba(20, 24, 60, 0.3), 0 1px 3px rgba(20, 24, 60, 0.06);
  --card-shadow: 0 1px 2px rgba(16, 18, 40, 0.04);
  color-scheme: light;
}

/* ───────────── база ───────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font);
  font-feature-settings: "cv05", "cv08", "ss03";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none;
  transition: background-color .4s ease;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }

/* один мягкий отсвет сверху в цвет открытого предмета */
.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient i { position: absolute; left: 50%; top: -34vh; width: 130vw; height: 62vh; transform: translateX(-50%); border-radius: 50%;
  background: var(--tint); opacity: .16; filter: blur(70px); transition: background-color 1s ease; }
:root[data-theme="light"] .ambient i { opacity: .1; }

/* ───────────── нижняя панель ───────────── */
.bar {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--safe-b) + 10px);
  height: var(--bar-h); padding: 0 8px; border-radius: 22px;
  display: flex; align-items: center;
  background: var(--bar-bg); border: 0.5px solid var(--bar-line); box-shadow: var(--bar-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  transform-origin: 50% 100%; transform: translateX(-50%); will-change: transform;
  transition: opacity .25s ease;
}
.bar.hidden { opacity: 0; pointer-events: none; }
/* таб-бар: круг «Главная» слева + капсула с остальными вкладками; общий масштаб на обёртке */
#tabbar {
  width: min(calc(100% - 20px), 470px); height: 62px; padding: 0; gap: 10px; border-radius: 0;
  background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.tb-pill {
  position: relative; flex: 1 1 0; min-width: 0; height: 62px; padding: 0 10px; border-radius: 22px;
  display: flex; align-items: center;
  background: var(--bar-bg); border: 0.5px solid var(--bar-line); box-shadow: var(--bar-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
#tabbar .tb-home {
  position: relative; flex: none; width: 62px; height: 62px; border-radius: 22px; display: grid; place-items: center; gap: 0;
  color: var(--text-2); background: var(--bar-bg); border: 0.5px solid var(--bar-line); box-shadow: var(--bar-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease, transform .25s var(--ease-out);
}
.tb-home svg.i { width: 26px; height: 26px; stroke-width: 2; transition: transform .35s var(--ease-out); }
#tabbar .tb-home:active { transform: scale(.92); }
#tabbar .tb-home.on { color: var(--accent-ink); background: var(--accent); border-color: transparent;
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 80%, transparent), var(--bar-shadow); }
.tb-home.on svg.i { stroke-width: 2.2; }
.tb-pill .lens {
  top: 10px; width: 40px; height: 40px; opacity: 0; scale: .55;
  transition: opacity .22s ease, scale .38s var(--ease-out);
}
.tb-pill .lens.show { opacity: 1; scale: 1; }
.tb-pill .tab .ic { width: 40px; height: 40px; }
.tb-pill .tab .lb { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
#readbar { width: min(calc(100% - 24px), 420px); gap: 6px; padding: 0 9px; }
.bottom-fade {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--safe-b) + 100px); z-index: 20; pointer-events: none;
  background: linear-gradient(to top, var(--bg) 20%, color-mix(in srgb, var(--bg) 60%, transparent) 55%, transparent);
}
/* индикатор активной вкладки — ровный круг под иконкой, переезжает на пружине */
.bar .lens { position: absolute; z-index: 0; top: 8px; left: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--accent-soft); will-change: transform; }
.tab {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--text-3); transition: color .2s ease;
}
.tab .ic { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; transition: transform .25s var(--ease-out); }
.tab .ic svg.i { width: 22px; height: 22px; }
.tab .lb { font-size: 10.5px; font-weight: 600; line-height: 1.1; letter-spacing: .005em; white-space: nowrap; }
.tab:active .ic { transform: scale(.88); }
.tab.on { color: var(--text); }
.tab.on .ic { color: var(--accent); }
.tab.on .ic svg.i { stroke-width: 2.2; }
.tab.on .lb { font-weight: 700; }
.tab .dot { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bar-bg); }

.rb-btn {
  width: 50px; height: 50px; flex: none; border-radius: 16px; display: grid; place-items: center;
  color: var(--text); background: var(--surface-2); transition: transform .2s var(--ease-out), opacity .2s ease;
}
.rb-btn:active { transform: scale(.9); }
.rb-btn[disabled] { opacity: .3; pointer-events: none; }
.seg { position: relative; flex: 1; height: 50px; display: flex; padding: 4px; border-radius: 16px; background: var(--surface-2); }
.seg .lens { top: 4px; height: 42px; border-radius: 12px; background: var(--surface-3); box-shadow: 0 1px 3px rgba(0, 0, 0, .28); }
:root[data-theme="light"] .seg .lens { background: #fff; box-shadow: 0 1px 3px rgba(16, 18, 40, .14), 0 0 0 .5px rgba(16, 18, 40, .06); }
.seg button {
  position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--text-3); border-radius: 12px; transition: color .2s ease;
}
.seg button svg.i { width: 17px; height: 17px; }
.seg button.on { color: var(--text); }
.seg button.on svg.i { color: var(--accent); }
.seg button[disabled] { opacity: .35; }

#readprog {
  position: fixed; z-index: 40; left: 0; right: 0; top: var(--safe-t); height: 2px; pointer-events: none;
  background: var(--tint); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; transition: opacity .3s ease;
}
#readprog.on { opacity: 1; }

/* ───────────── страницы ───────────── */
#stage { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.page {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 0 16px calc(var(--safe-b) + var(--bar-h) + 44px);
  touch-action: pan-y; scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page > .wrap { max-width: 680px; margin: 0 auto; }
.page.enter-push { transform: translateX(100%); }
.page.enter-pop { transform: translateX(-26%); opacity: .6; }
.page.enter-fade { opacity: 0; transform: translateY(8px); }
.page.leave-push { transform: translateX(-26%); opacity: .5; }
.page.leave-pop { transform: translateX(100%); }
.page.leave-fade { opacity: 0; }
.page.anim { transition: transform .45s var(--ease-out), opacity .45s var(--ease-out); }
.page.anim.fast { transition-duration: .25s; }
.page.enter-push, .page.leave-pop { background: var(--bg); box-shadow: -16px 0 32px -18px rgba(0, 0, 0, .55); }

.nav {
  position: sticky; top: 0; z-index: 10; margin: 0 -16px;
  height: calc(var(--safe-t) + 54px); padding: var(--safe-t) 12px 0;
  display: flex; align-items: center; gap: 8px;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 0.5px 0 var(--line-2);
}
.nav .ttl {
  position: absolute; left: 60px; right: 60px; bottom: 0; height: 54px; display: flex; align-items: center; justify-content: center;
  font: 700 16px/1.2 var(--font-d); letter-spacing: -.01em; white-space: nowrap; overflow: hidden;
  opacity: 0; transform: translateY(5px); transition: opacity .2s ease, transform .28s var(--ease-out); pointer-events: none;
}
.nav .ttl > span { overflow: hidden; text-overflow: ellipsis; }
.nav.scrolled .ttl { opacity: 1; transform: none; }
.nav .sp { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--text);
  background: var(--surface); border: 0.5px solid var(--line); box-shadow: var(--card-shadow);
  transition: transform .2s var(--ease-out), color .2s ease, opacity .2s ease;
}
.icon-btn svg.i { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.9); }
.icon-btn.on { color: var(--warn); }
.icon-btn.on svg.i { fill: currentColor; }
.nav .icon-btn + .icon-btn { margin-left: 6px; }
.ava-btn { padding: 0; overflow: hidden; border-radius: 50%; }
.ava-btn .ava { width: 100%; height: 100%; font-size: 13px; }
.nav:not(.scrolled) .ava-btn { opacity: 0; pointer-events: none; }

/* ───────────── заголовки ───────────── */
.hero { padding: 2px 2px 18px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
h1.large { margin: 0; font: 800 31px/1.12 var(--font-d); letter-spacing: -.03em; text-wrap: balance; }
.grad { color: var(--accent); }
.hero .sub { margin: 8px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 2px 12px; }
.section-h h2 { margin: 0; font: 750 19px/1.2 var(--font-d); letter-spacing: -.02em; }
.section-h button { font-size: 14px; font-weight: 600; color: var(--accent); }

/* ───────────── карточки и кнопки ───────────── */
.card { position: relative; background: var(--surface); border-radius: var(--r-card); border: 0.5px solid var(--line); box-shadow: var(--card-shadow); }
.press { transition: transform .2s var(--ease-out), background-color .15s ease; }
.press:active { transform: scale(.98); background-color: var(--press); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 16px; border-radius: 13px; font-size: 15px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: transform .2s var(--ease-out), background-color .2s ease, opacity .2s ease;
}
.btn svg.i { width: 18px; height: 18px; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.btn.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.btn.block { width: 100%; height: 50px; font-size: 16px; border-radius: 15px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

.searchbox {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px;
  border-radius: 15px; background: var(--surface); border: 0.5px solid var(--line); box-shadow: var(--card-shadow);
  color: var(--text-3); text-align: left; transition: border-color .2s ease, box-shadow .2s ease;
}
.searchbox svg.i { width: 20px; height: 20px; }
.searchbox input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox.fake span { font-size: 15.5px; color: var(--text-3); }
.searchbox .clr { width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; background: var(--surface-3); color: var(--text-2); }
.searchbox .clr svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.searchbox.has .clr { display: grid; }
.searchbox:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ───────────── главная ───────────── */
.me-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px 2px 16px; text-align: left; }
.me-row .tx { flex: 1; min-width: 0; }
.me-row b { display: block; font: 750 17px/1.25 var(--font-d); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-row small { display: block; font-size: 13px; color: var(--text-3); font-weight: 500; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-row .chev { color: var(--text-3); display: grid; place-items: center; }
.me-row .chev svg.i { width: 18px; height: 18px; }
.me-row:active { opacity: .7; }

.exam {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; overflow: hidden; border: 0;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: #fff;
}
.cnt-big { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; height: 60px; padding: 0 10px; border-radius: 16px; background: rgba(255, 255, 255, .18); }
.cnt-big b { font: 800 28px/1 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cnt-big span { font-size: 11px; font-weight: 700; margin-top: 2px; opacity: .9; }
.cnt-big.word b { font-size: 16px; }
.exam .tx { flex: 1; min-width: 0; }
.exam small { display: block; font-size: 13px; font-weight: 600; opacity: .82; }
.exam .tx b { display: block; font: 750 17px/1.3 var(--font-d); margin-top: 2px; }
.exam > .ico { flex: none; opacity: .85; }
.notice { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 10px; }
.notice .ico { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.notice .ico svg.i { width: 19px; height: 19px; }
.notice .tx { flex: 1; min-width: 0; }
.notice small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); }
.notice p { margin: 3px 0 0; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: break-word; }

.cont { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-top: 10px; text-align: left; }
.cont .ico { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.cont .tx { flex: 1; min-width: 0; }
.cont small { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.cont b { display: block; font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cont .go { color: var(--text-3); }

.numgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.numchip {
  aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center;
  font: 700 17px/1 var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  background: var(--surface); border: 0.5px solid var(--line); box-shadow: var(--card-shadow);
}

.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.subj { --c: var(--accent); display: flex; flex-direction: column; padding: 14px; min-height: 148px; text-align: left; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 13%, transparent), transparent 62%), var(--surface); }
.subj .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.subj .ico svg.i { width: 22px; height: 22px; }
.subj .short { margin-top: 14px; font: 800 21px/1.1 var(--font-d); letter-spacing: -.025em; }
.subj .full { margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--text-3); flex: 1; }
.subj .cnt { margin-top: 10px; font-size: 12px; font-weight: 650; color: var(--c); }
.subj .wm { display: none; }

.refgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.refc { --c: var(--accent); display: flex; flex-direction: column; align-items: flex-start; padding: 14px; text-align: left; }
.refc .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); margin-bottom: 12px; }
.refc .ico svg.i { width: 20px; height: 20px; }
.refc b { font-size: 15px; font-weight: 650; }
.refc small { font-size: 12.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 1px; }

.wide-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left; width: 100%; }
.wide-card .ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c, var(--accent)) 15%, transparent); color: var(--c, var(--accent)); }
.wide-card .tx { flex: 1; min-width: 0; }
.wide-card b { display: block; font-size: 15.5px; font-weight: 650; }
.wide-card small { display: block; font-size: 13.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide-card .chev { color: var(--text-3); }
.empty-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.empty-card .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.empty-card b { font-size: 15.5px; font-weight: 650; }
.empty-card p { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }

/* ───────────── предмет ───────────── */
.subj-hero .badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.subj-hero .badge svg.i { width: 27px; height: 27px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  --c: var(--accent); flex: none; height: 34px; padding: 0 13px; border-radius: 11px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); background: var(--surface); border: 0.5px solid var(--line);
  transition: background-color .2s ease, color .2s ease, transform .2s var(--ease-out);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip i.d { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.qlist { display: flex; flex-direction: column; margin-top: 12px; background: var(--surface); border-radius: var(--r-card); border: 0.5px solid var(--line); box-shadow: var(--card-shadow); overflow: hidden; }
.qlist:empty { display: none; }
.qrow { --c: var(--accent); position: relative; display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 0; background: none; border: 0; box-shadow: none; }
.qrow + .qrow::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: 0.5px; background: var(--line-2); }
.qrow.press:active { transform: none; background: var(--press); }
.num {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 750 16px/1 var(--font-d); font-variant-numeric: tabular-nums; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.num small { font-size: 8.5px; font-weight: 800; letter-spacing: .02em; margin-bottom: 3px; text-transform: uppercase; }
.qrow .tx { flex: 1; min-width: 0; }
.qrow b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.qrow small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.38; color: var(--text-3); margin-top: 2px; }
.qrow .star { color: var(--warn); flex: none; }
.qrow .star svg.i { width: 16px; height: 16px; fill: currentColor; }
.qrow .chev { color: var(--text-3); opacity: .55; flex: none; }
.qrow .chev svg.i { width: 17px; height: 17px; }
.searchbox + .qlist { margin-top: 12px; }
.qlist > .empty { padding: 32px 20px; }

/* ───────────── вопрос ───────────── */
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent);
}
.tag.muted { color: var(--text-2); background: var(--surface-2); }
.tag svg.i { width: 15px; height: 15px; }
h1.qt { margin: 0; font: 800 25px/1.18 var(--font-d); letter-spacing: -.025em; text-wrap: balance; }
.qcard { margin-top: 16px; padding: 14px 16px; overflow: hidden; background: var(--surface); }
.qcard::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.qcard .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c); margin-bottom: 6px; }
.qcard p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-2); white-space: pre-line; }
.qcard.clamp p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .more { margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.qcard .fig { margin: 12px 0 0; }

.ans-h { display: flex; align-items: center; gap: 8px; margin: 26px 2px 2px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.ans-h svg.i { width: 15px; height: 15px; color: var(--c, var(--accent)); }
.ans-h .sp { flex: 1; height: 0.5px; background: var(--line-2); }

/* типографика ответа */
.answer { font-size: calc(16.5px * var(--fs)); line-height: 1.65; color: var(--text); hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.answer p { margin: .6em 0; text-wrap: pretty; }
.answer b { font-weight: 650; }
.answer mark { background: color-mix(in srgb, var(--c) 22%, transparent); color: inherit; padding: 0 .2em; border-radius: 4px; }
.answer h4 { margin: 1.7em 0 .45em; font: 750 calc(18px * var(--fs))/1.3 var(--font-d); letter-spacing: -.015em; hyphens: manual; display: flex; align-items: baseline; gap: 9px; }
.answer h4::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 3px; background: var(--c); transform: translateY(-2px); }
.answer > :first-child { margin-top: .3em; }
.answer ul, .answer ol { margin: .5em 0; padding: 0; list-style: none; counter-reset: li; }
.answer li { position: relative; padding-left: 1.35em; margin: .38em 0; }
.answer ul > li::before { content: ""; position: absolute; left: .25em; top: .68em; width: .36em; height: .36em; border-radius: 50%; background: var(--c); opacity: .85; }
.answer ol > li { counter-increment: li; padding-left: 1.85em; }
.answer ol > li::before { content: counter(li); position: absolute; left: 0; top: .2em; min-width: 1.35em; height: 1.35em; border-radius: .42em; font: 700 .76em/1.35em var(--font-d); text-align: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.answer li.lv1 { margin-left: 1.3em; }
.answer li.lv2 { margin-left: 2.6em; }
.answer ul > li.lv1::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.answer .part { display: flex; align-items: center; gap: 10px; margin: 1.6em 0 .4em; }
.answer .part::after { content: ""; flex: 1; height: 0.5px; background: var(--line-2); }
.answer .part span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 4px 9px; border-radius: 7px; }
.answer .part:first-child { margin-top: .4em; }
.answer .mb { margin: .8em 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; text-align: center; scrollbar-width: none; }
.answer .mb::-webkit-scrollbar { display: none; }
.answer .katex { font-size: 1.05em; }
.answer .katex-display { margin: .2em 0; }
.answer .nw { white-space: nowrap; }
.answer sub, .answer sup { font-size: .72em; line-height: 0; }
.callout {
  --cc: var(--c); position: relative; margin: 1em 0; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--cc) 9%, var(--surface)); border: 0.5px solid color-mix(in srgb, var(--cc) 22%, transparent);
  font-size: .96em; line-height: 1.55;
}
.callout::before { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cc); }
.callout.key::before { content: "Главное"; }
.callout.tip { --cc: var(--warn); }
.callout.tip::before { content: "Как запомнить"; }
.callout.warn { --cc: var(--danger); }
.callout.warn::before { content: "Внимание"; }
.callout:first-child { margin-top: .4em; }
.fig { position: relative; margin: 1em 0; background: var(--figure-bg); border-radius: 14px; padding: 10px; overflow: hidden; cursor: zoom-in; border: 0.5px solid var(--line); }
.fig img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 6px; background: #fff; }
.fig figcaption { margin: 8px 4px 0; font-size: 13px; line-height: 1.4; color: #4b5060; text-align: center; hyphens: manual; }
.fig.broken { cursor: pointer; }
.fig.broken img { visibility: hidden; height: 0 !important; }
.fig.broken::after { content: "Схема не загрузилась · нажми, чтобы повторить"; display: block; padding: 22px 12px; text-align: center; font-size: 14px; font-weight: 600; color: #5a5f70; }
.tbl { margin: 1em -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tbl::-webkit-scrollbar { display: none; }
.tbl table { border-collapse: separate; border-spacing: 0; font-size: .9em; line-height: 1.45; min-width: 100%; border-radius: 12px; overflow: hidden; border: 0.5px solid var(--line-2); background: var(--surface); }
.tbl td, .tbl th { padding: 9px 12px; vertical-align: top; text-align: left; border-bottom: 0.5px solid var(--line-2); min-width: 90px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { background: var(--surface-2); font-weight: 650; }
.tbl td + td, .tbl th + th { border-left: 0.5px solid var(--line-2); }
.next-card { margin-top: 30px; }
.next-card small.k { font-size: 12px; font-weight: 600; color: var(--text-3); white-space: normal; }
.next-card b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ───────────── билеты ───────────── */
.tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tile { aspect-ratio: 1 / 0.9; display: flex; flex-direction: column; justify-content: space-between; padding: 12px; text-align: left; overflow: hidden; }
.tile .k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.tile .n { font: 800 32px/1 var(--font-d); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.strip { display: flex; gap: 3px; }
.strip i { flex: 1; height: 3px; border-radius: 2px; background: var(--c); }
.tq { --c: var(--accent); display: block; width: 100%; text-align: left; padding: 14px 16px; margin-top: 10px; }
.tq .row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tq .row .sp { flex: 1; }
.tq .qn { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 750 13px/1 var(--font-d); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tq .chev { color: var(--text-3); opacity: .55; }
.tq .chev svg.i { width: 17px; height: 17px; }
.tq b { display: block; font: 750 16.5px/1.3 var(--font-d); letter-spacing: -.015em; }
.tq p { margin: 6px 0 0; font-size: 14px; line-height: 1.48; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tq .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.tq .thumbs img { height: 70px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 9px; padding: 4px; border: 0.5px solid var(--line); }
.pager { display: flex; gap: 10px; margin-top: 18px; }
.pager .btn { flex: 1; height: 46px; }

/* ───────────── поиск ───────────── */
.res { --c: var(--accent); display: block; width: 100%; text-align: left; padding: 13px 15px; margin-top: 8px; }
.res .row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.res .tag { height: 24px; font-size: 12px; }
.res b { display: block; font-size: 15px; font-weight: 650; line-height: 1.3; }
.res p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res mark, .qrow mark, .fcard mark, .term mark { background: color-mix(in srgb, var(--warn) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.res-count { margin: 16px 2px 0; font-size: 13px; color: var(--text-3); font-weight: 600; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.empty { text-align: center; padding: 40px 24px; color: var(--text-2); }
.empty .ico { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.empty .ico svg.i { width: 27px; height: 27px; }
.empty h3 { margin: 0 0 6px; font: 750 18px/1.3 var(--font-d); color: var(--text); }
.empty p { margin: 0 auto; max-width: 300px; font-size: 14.5px; line-height: 1.5; }

/* ───────────── админка ───────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; text-align: left; }
.stat b { display: block; font: 800 27px/1 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.stat.hl b { color: var(--warn); }
.add-card { padding: 16px; margin-top: 12px; }
.add-card h3 { margin: 0 0 4px; font: 750 17px/1.3 var(--font-d); }
.add-card p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); }
.add-row { display: flex; gap: 8px; }
.add-row .searchbox { flex: 1; width: auto; min-width: 0; height: 44px; background: var(--surface-2); border-color: transparent; box-shadow: none; }
.add-row .btn { height: 44px; }
.users { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); }
.ava { position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; background: var(--c, #6c63ff); overflow: hidden; }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava.sm { width: 30px; height: 30px; font-size: 12px; }
.ava.md { width: 46px; height: 46px; font-size: 17px; }
.ava.xl { width: 92px; height: 92px; font-size: 32px; }
.user .tx { flex: 1; min-width: 0; }
.user b { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user b .crown { color: var(--warn); display: inline-flex; }
.user b .crown svg.i { width: 15px; height: 15px; }
.user small { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.user .acts { display: flex; gap: 6px; flex: none; }
.user .acts .btn { height: 36px; padding: 0 12px; }
.user .acts .icon-btn { width: 36px; height: 36px; background: var(--surface-2); border: 0; box-shadow: none; }
.set-card .field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 13px; background: var(--surface-2); }
.set-card .field.col { flex-direction: column; align-items: stretch; }
.set-card .field span { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.set-card .field span svg.i { width: 17px; height: 17px; color: var(--accent); }
.set-card input[type="date"] { border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 600; min-width: 0; }
.set-card textarea { width: 100%; margin-top: 8px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--text); font-size: 15px; line-height: 1.45; }
.set-card textarea::placeholder { color: var(--text-3); }
.check { display: flex; align-items: center; gap: 10px; margin: 14px 2px; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* ───────────── профиль ───────────── */
.profile { text-align: center; padding: 4px 0 2px; }
.pf-ava { display: inline-block; padding: 3px; border-radius: 50%; background: var(--surface); border: 0.5px solid var(--line-2); }
.pf-name { margin: 12px 0 0; font: 800 26px/1.15 var(--font-d); letter-spacing: -.03em; }
.pf-sub { margin-top: 3px; color: var(--text-3); font-size: 15px; }
.pf-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.list-h { margin: 26px 6px 8px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.list { padding: 2px 0; overflow: hidden; }
.li { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 9px 14px; text-align: left; cursor: default; }
button.li, label.li { cursor: pointer; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 0.5px; background: var(--line-2); }
.li.press:active { transform: none; background: var(--press); }
.li-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.li-ico svg.i { width: 17px; height: 17px; }
.li-tx { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; }
.li-val { color: var(--text-3); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.li-end { color: var(--text-3); display: grid; }
.li-end svg.i { width: 17px; height: 17px; }
.mini-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.mini-seg button { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); transition: background-color .2s ease, color .2s ease; }
.mini-seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
:root[data-theme="light"] .mini-seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(16,18,40,.14); }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.stepper button { width: 32px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text); }
.stepper button:active { background: var(--surface-3); }
.stepper button svg.i { width: 15px; height: 15px; stroke-width: 2.4; }
.stepper b { min-width: 44px; text-align: center; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 15px; margin: 0; background: var(--surface-3); position: relative; cursor: pointer; transition: background-color .25s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: transform .3s var(--ease-out); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px 0; }
.pf-stats div { padding: 12px 6px; text-align: center; }
.pf-stats b { display: block; font: 800 23px/1.1 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pf-stats span { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.pf-foot { margin: 26px 0 0; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }

/* ───────────── справочник ───────────── */
.grp { display: flex; align-items: center; gap: 8px; margin: 22px 2px 10px; }
.grp .gi { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.grp .gi svg.i { width: 15px; height: 15px; }
.grp b { font: 750 17px/1.2 var(--font-d); letter-spacing: -.01em; }
.grp .gt { flex: 1; min-width: 0; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp em { font-style: normal; font-size: 13px; font-weight: 650; color: var(--text-3); }
.fcard { --c: var(--accent); padding: 13px 15px; margin-top: 8px; }
.fh { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fh b { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.fh .tag { flex: none; height: 24px; font-size: 12px; }
.fx { margin: 10px -4px 2px; padding: 4px; overflow-x: auto; overflow-y: hidden; text-align: center; scrollbar-width: none; font-size: 17px; }
.fx::-webkit-scrollbar { display: none; }
.fx .katex-display { margin: 0; }
.fcard p { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.letter { margin: 22px 4px 8px; font: 800 20px/1 var(--font-d); color: var(--accent); }
.term { --c: var(--accent); display: block; width: 100%; text-align: left; padding: 13px 15px; margin-top: 8px; }
.term > b { display: block; font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.term p { margin: 5px 0 10px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.term p b { color: var(--text); font-weight: 600; }
.term .tag { height: 24px; font-size: 12px; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.shot { --c: var(--accent); display: flex; flex-direction: column; text-align: left; border-radius: 16px; overflow: hidden; background: var(--surface); border: 0.5px solid var(--line); box-shadow: var(--card-shadow); }
.shot .pic { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #fff; padding: 8px; }
.shot .pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .3s ease; }
.shot .pic img[data-src] { opacity: 0; }
.shot .cap { padding: 9px 11px 11px; font-size: 13px; line-height: 1.35; font-weight: 550; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shot .cap em { display: block; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--c); margin-bottom: 2px; }

/* ───────────── вход, тост, лайтбокс ───────────── */
.gate { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; }
.gate .box { max-width: 360px; width: 100%; padding: 28px 22px 22px; border-radius: 26px; background: var(--surface); border: 0.5px solid var(--line); box-shadow: var(--card-shadow); }
.gate .lock { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.gate .lock svg.i { width: 30px; height: 30px; }
.gate h2 { margin: 0 0 8px; font: 800 23px/1.2 var(--font-d); letter-spacing: -.02em; }
.gate p { margin: 0 0 18px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.idchip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.idchip svg.i { width: 16px; height: 16px; color: var(--text-3); }
.logo { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: var(--accent); }
.logo svg.i { width: 34px; height: 34px; stroke-width: 2.2; fill: rgba(255,255,255,.25); }
.splash .logo { animation: breathe 1.4s var(--ease-out) infinite alternate; }
@keyframes breathe { from { transform: scale(.94); opacity: .75; } to { transform: scale(1); opacity: 1; } }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -20px);
  padding: 10px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); box-shadow: 0 10px 28px -10px rgba(0,0,0,.5);
  transition: opacity .22s ease, transform .4s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 70; display: none; touch-action: none; }
.lightbox.open { display: block; }
.lb-bg { position: absolute; inset: 0; background: rgba(4, 5, 8, .92); opacity: 0; transition: opacity .3s ease; }
.lightbox.show .lb-bg { opacity: 1; }
.lightbox img { position: absolute; left: 0; top: 0; max-width: none; background: #fff; border-radius: 10px; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; }
.lb-close { position: absolute; right: 14px; top: calc(var(--safe-t) + 12px); width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); opacity: 0; transition: opacity .3s ease; }
.lightbox.show .lb-close { opacity: 1; }
.lb-cap { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 14px); display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 18px; color: #fff; background: rgba(28, 29, 36, .96); border: 0.5px solid rgba(255,255,255,.1);
  opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .4s var(--ease-out); }
.lb-cap[hidden] { display: none; }
.lightbox.show .lb-cap { opacity: 1; transform: none; }
.lb-cap span { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-cap .btn { flex: none; }

/* ───────────── оформление: тема и цвет акцента ───────────── */
.li.col { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 12px; padding-bottom: 14px; }
.li-row { display: flex; align-items: center; gap: 12px; }
.li-val.hexv { font-size: 14px; color: var(--text-3); }
.li-val.hexv.code { font: 600 13.5px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-transform: uppercase; color: var(--text-2); }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.sw { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--sw); display: grid; place-items: center; color: #fff;
  transition: transform .2s var(--ease-out), box-shadow .2s ease; }
.sw:active { transform: scale(.88); }
.sw.on { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px var(--sw); }
.sw svg.i { width: 15px; height: 15px; stroke-width: 3; opacity: 0; transition: opacity .2s ease; }
.sw.on svg.i { opacity: 1; }
.sw.custom { background: conic-gradient(from 180deg, #ff5c6c, #f5b942, #34c77b, #22c3d6, #4f8cff, #8d7ff7, #ff6fb5, #ff5c6c); --sw: var(--accent); }
.sw.custom::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: var(--surface); }
.sw.custom.on::after { background: var(--accent); inset: 22%; }
.sw.custom svg.i { position: relative; z-index: 1; }
.hexrow { display: flex; align-items: center; gap: 8px; }
.hexrow[hidden] { display: none; }
.hexpick { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--accent); box-shadow: inset 0 0 0 0.5px var(--line-2); cursor: pointer; }
.hexpick input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.hexin { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid transparent; outline: 0; background: var(--surface-2);
  font: 600 15px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.hexin:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.hexin.bad { border-color: var(--danger); }
.mini-seg.three button { padding: 0 9px; }

/* ───────────── админка: кто в сети ───────────── */
.ava-wrap { position: relative; flex: none; display: grid; }
.ava-wrap.is-online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--surface); }
.online-tx { color: var(--ok); font-weight: 650; }
.on-stat b { display: flex; align-items: center; gap: 8px; }
.live { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .live { animation: none; } }

/* ───────────── выделение: интерфейс не копируется, тексты ответов, условий и формул — можно ───────────── */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, svg { -webkit-user-drag: none; }
.answer, .qcard p, .fcard .fx, .fcard p, .notice p, input, textarea { -webkit-user-select: text; user-select: text; }
.answer img { -webkit-touch-callout: none; }
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }

.li-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-3); margin-top: 1px; }
.li-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.li-badge[hidden] { display: none; }

/* ───────────── доступность и широкие экраны ───────────── */
@media (prefers-reduced-motion: reduce) {
  .page.anim { transition: opacity .2s ease !important; transform: none !important; }
  .page.enter-push, .page.enter-pop, .page.leave-push, .page.leave-pop { transform: none !important; }
  .splash .logo, .sk { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar, .nav.scrolled { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .bar { background: var(--surface); }
}
@media (min-width: 720px) {
  .subjects { grid-template-columns: repeat(4, 1fr); }
  .tgrid { grid-template-columns: repeat(5, 1fr); }
  .numgrid { grid-template-columns: repeat(10, 1fr); }
  .shots { grid-template-columns: repeat(3, 1fr); }
}
