/* =====================================================================
   BestMate — стили публичной части (админка использует style.css)
   Светлая тема по умолчанию, тёмная — по переключателю. Без градиентов.
   ===================================================================== */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: block;
  src: url('/fonts/manrope-cyrillic.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-weight: 200 800;
  font-display: block;
  src: url('/fonts/manrope-latin.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 {
  --ink: #0b1230;
  --muted: #5f6b8c;
  --bg: #f4f6fd;
  --surface: #ffffff;
  --tint: #eef2ff;
  --line: #e4e9f7;
  --line-strong: #d0d9f0;
  --brand: #2554ff;
  --brand-dark: #1a3fd1;
  --brand-soft: rgba(37, 84, 255, .1);
  --hero: #2146e8;
  --yellow: #ffd23f;
  --green: #12b981;
  --red: #ef4444;
  --tg: #229ed9;
  --tg-dark: #1b87bb;
  --navy: #0b1230;
  --hover: #f0f3fc;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 60, .04), 0 8px 28px rgba(15, 23, 60, .07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 60, .16);
  --max: 1240px;
  --header-h: 4.6rem;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --ink: #e9edfb;
  --muted: #9aa5c6;
  --bg: #14171f;
  --surface: #1c202b;
  --tint: #232a3d;
  --line: #2b3142;
  --line-strong: #394057;
  --brand: #6f90ff;
  --brand-dark: #93acff;
  --brand-soft: rgba(111, 144, 255, .16);
  --hero: #1b2a73;
  --navy: #0d1020;
  --hover: #262c3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { font-size: clamp(16px, .3vw + 11px, 17px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex-shrink: 0; vertical-align: middle; }
[hidden] { display: none !important; }
#catalog, #exams, #subjects { scroll-margin-top: 90px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 800; font-size: .98rem; line-height: 1.1; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--navy); color: #fff !important; }
.btn-dark:hover { background: #1d2750; }
.btn-secondary, .btn-outline { background: var(--surface); color: var(--ink) !important; border-color: var(--line-strong); }
.btn-secondary:hover, .btn-outline:hover { border-color: var(--brand); color: var(--brand) !important; }
.btn-yellow { background: var(--yellow); color: #0b1230 !important; }
.btn-yellow:hover { background: #ffc61a; }
.btn-tg { background: var(--tg); color: #fff !important; }
.btn-tg:hover { background: var(--tg-dark); }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }

/* ---------- шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .85rem 24px; position: relative; }
.logo-block { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none !important; flex-shrink: 0; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 2.7rem; height: 2.7rem; border-radius: .85rem; background: var(--brand); color: #fff; flex-shrink: 0; }
.logo-mark svg { width: 1.45rem; height: 1.45rem; }
.logo-mark-sm { width: 2.2rem; height: 2.2rem; border-radius: .7rem; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; color: var(--ink); }
.logo-block:hover .logo { color: var(--brand); }
.logo-tagline { display: none; }
.top-links { display: flex; align-items: center; gap: .15rem; margin-left: .8rem; }
.top-links a, .top-link-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .65rem .9rem; border: none; border-radius: .8rem; background: none; color: var(--ink); font: inherit; font-weight: 700; font-size: 1rem; white-space: nowrap; cursor: pointer; text-decoration: none !important; }
.top-links a:hover, .top-link-btn:hover { background: var(--hover); }
.nav-caret { font-size: .6rem; opacity: .7; }
.header-search-btn, .theme-toggle, .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.9rem; height: 2.9rem; padding: 0; border: 1px solid var(--line-strong); border-radius: .9rem; background: var(--surface); color: var(--ink); cursor: pointer; flex-shrink: 0; text-decoration: none !important; }
.header-search-btn { margin-left: auto; }
.header-search-btn:hover, .theme-toggle:hover, .nav-toggle:hover { border-color: var(--brand); color: var(--brand); }
.nav-toggle { display: none; }
.cta-tg { display: inline-flex; align-items: center; gap: .5rem; height: 2.9rem; padding: 0 1.2rem; border-radius: .9rem; background: var(--tg); color: #fff !important; font-weight: 800; font-size: .98rem; text-decoration: none !important; flex-shrink: 0; }
.cta-tg:hover { background: var(--tg-dark); }
.cta-tg svg { width: 1.2rem; height: 1.2rem; }
.main-nav { display: none; position: absolute; top: calc(100% + 6px); left: 24px; z-index: 50; width: min(560px, calc(100vw - 48px)); grid-template-columns: 1fr 1fr; gap: 4px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.main-nav.open { display: grid; }
.main-nav-item { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem; border-radius: .8rem; color: var(--ink) !important; text-decoration: none !important; }
.main-nav-item:hover { background: var(--hover); }
.main-nav-icon { font-size: 1.3rem; line-height: 1; margin-top: .1rem; }
.main-nav-text { display: flex; flex-direction: column; gap: .1rem; }
.main-nav-text strong { font-size: .95rem; }
.main-nav-text small { color: var(--muted); font-size: .78rem; }
.mobile-only { display: none !important; }

/* ---------- главный экран ---------- */
.home-hero { position: relative; background: var(--hero); color: #fff; overflow: hidden; isolation: isolate; }
.home-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='2' cy='2' r='1.1' fill='white' fill-opacity='.22'/%3E%3C/svg%3E"); }
.home-hero::after { content: ""; position: absolute; z-index: -1; right: -6%; top: -45%; width: 62%; aspect-ratio: 1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cg fill='none' stroke='white' stroke-opacity='.16' stroke-width='2'%3E%3Ccircle cx='300' cy='300' r='290'/%3E%3Ccircle cx='300' cy='300' r='225'/%3E%3Ccircle cx='300' cy='300' r='160'/%3E%3Ccircle cx='300' cy='300' r='95'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 2rem; align-items: center; padding-top: 4.4rem; padding-bottom: 7.4rem; }
.hero-copy h1 { margin: 0 0 1.1rem; font-size: clamp(2.4rem, 4.6vw, 3.7rem); line-height: 1.05; font-weight: 800; letter-spacing: -.035em; color: #fff; }
.hero-copy h1.hero-title-long { font-size: clamp(2rem, 3.6vw, 2.9rem); }
.hl { background: var(--yellow); color: #0b1230; border-radius: .22em; padding: .02em .2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-sub { max-width: 34rem; color: rgba(255, 255, 255, .86); font-size: 1.16rem; line-height: 1.55; }
.hero-sub p { margin: 0; }
.hero-search { display: flex; align-items: center; gap: .5rem; max-width: 40rem; margin-top: 1.7rem; padding: .45rem; background: var(--surface); border-radius: 999px; box-shadow: 0 0 0 .4rem rgba(255, 255, 255, .22), 0 14px 34px rgba(8, 20, 90, .35); }
.hero-search-field { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; padding: 0 .6rem 0 1.1rem; color: var(--muted); }
.hero-search-field input { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 1.08rem; font-weight: 500; color: var(--ink); padding: .8rem 0; }
.hero-search-field input::placeholder { color: var(--muted); }
.hero-search button { border: none; border-radius: 999px; background: var(--brand); color: #fff; padding: 1rem 2rem; font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; flex-shrink: 0; }
.hero-search button:hover { background: var(--brand-dark); }
.hero-chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; max-width: 40rem; }
.hero-chip { padding: .55rem 1rem; border: 1px solid rgba(255, 255, 255, .3); border-radius: .8rem; background: rgba(255, 255, 255, .12); color: #fff !important; font-weight: 700; font-size: .92rem; text-decoration: none !important; }
.hero-chip:hover { background: rgba(255, 255, 255, .24); }
.hero-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: 1.5rem 0 0; padding: 0; color: rgba(255, 255, 255, .92); font-weight: 700; font-size: .95rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: .45rem; }
.hero-facts svg { color: var(--yellow); }

/* иллюстрация справа */
.hero-art { position: relative; min-height: 26rem; }
.hero-art svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-card { position: absolute; background: var(--surface); color: var(--ink); border-radius: 1rem; box-shadow: 0 16px 38px rgba(8, 20, 90, .3); }
.art-tg { left: 0; bottom: 3.4rem; display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; max-width: 17rem; }
.art-tg .art-tg-ico { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--tg); color: #fff; flex-shrink: 0; }
.art-tg strong { display: block; font-size: .88rem; }
.art-tg span { display: block; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.art-formula { right: 0; top: 1.4rem; padding: .75rem 1.1rem; background: #0b1230; color: #fff; transform: rotate(4deg); }
.art-formula small { display: block; color: #aab6e3; font-size: .7rem; font-weight: 600; }
.art-formula b { font-size: 1.1rem; font-family: Georgia, 'Times New Roman', serif; font-style: italic; }

/* плашка «сегодня / скоро» */
.soon-wrap { position: relative; z-index: 3; margin-top: -4rem; }
.soon-card { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; padding: 1.7rem 2.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.6rem; box-shadow: var(--shadow-lg); }
.soon-label { display: inline-flex; align-items: center; gap: .55rem; font-size: .8rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.soon-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--red); display: inline-block; box-shadow: 0 0 0 .22rem rgba(239, 68, 68, .2); }
.soon-title { margin-top: .45rem; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.soon-num { color: var(--brand); font-size: 2.7rem; margin-right: .3rem; }
.soon-sub { margin-top: .15rem; color: var(--muted); font-weight: 600; }
.soon-btn { white-space: nowrap; }

/* ---------- блоки главной ---------- */
.home-block { padding-top: 5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.55rem); font-weight: 800; letter-spacing: -.03em; }
.section-sub { color: var(--muted); font-weight: 600; }
.link-more { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; }

.catalog-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 2rem; align-items: start; }
.cat-filters-btn { display: none; align-items: center; gap: .6rem; width: 100%; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 1rem; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.cat-filters { position: sticky; top: calc(var(--header-h) + 1rem); padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: var(--shadow); }
.cat-group + .cat-group { margin-top: 1.5rem; }
.cat-group h3 { margin: 0 0 .7rem; font-size: .95rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.cat-sections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cat-section { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .85rem; border-radius: .8rem; color: var(--ink) !important; font-weight: 700; font-size: .98rem; text-decoration: none !important; }
.cat-section b { color: var(--muted); font-weight: 700; font-size: .84rem; }
.cat-section:hover { background: var(--hover); }
.cat-section.active { background: var(--brand); color: #fff !important; }
.cat-section.active b { color: rgba(255, 255, 255, .85); }
.cat-grades, .subj-grades { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-grade, .subj-grade { display: inline-flex; align-items: center; justify-content: center; min-width: 2.9rem; height: 2.9rem; padding: 0 .4rem; border: 1px solid var(--line-strong); border-radius: .85rem; background: var(--surface); color: var(--ink) !important; font-weight: 800; text-decoration: none !important; }
.cat-grade:hover, .subj-grade:hover { border-color: var(--brand); }
.cat-grade.active, .subj-grade.active { background: var(--navy); border-color: var(--navy); color: #fff !important; }
.cat-filters select, .search-filters select { width: 100%; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: .9rem; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; }

.cat-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cat-found { color: var(--muted); font-weight: 600; }
.cat-found b { color: var(--ink); }
.cat-sort { display: inline-flex; padding: .25rem; background: var(--tint); border-radius: .9rem; }
.cat-sort a { padding: .55rem 1.2rem; border-radius: .7rem; color: var(--muted) !important; font-weight: 800; font-size: .92rem; text-decoration: none !important; }
.cat-sort a.active { background: var(--surface); color: var(--ink) !important; box-shadow: 0 1px 3px rgba(15, 23, 60, .12); }
.cat-active { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-active:not(:empty) { margin-bottom: 1rem; }
.cat-chip-x { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 999px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.cat-chip-x:hover { background: var(--brand); color: #fff; }
.cat-reset { border: none; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; padding: .45rem .4rem; }
.cat-reset:hover { color: var(--ink); }

.cat-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; overflow: hidden; box-shadow: var(--shadow); transition: opacity .15s; }
.cat-list.loading { opacity: .5; }
.cat-list li + li { border-top: 1px solid var(--line); }
.cat-item { display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; padding: 1.35rem 1.7rem; color: var(--ink); text-decoration: none !important; }
.cat-item:hover { background: var(--hover); }
.cat-item h3 { margin: 0 0 .7rem; font-size: 1.15rem; line-height: 1.32; font-weight: 800; letter-spacing: -.015em; }
.cat-item:hover h3 { color: var(--brand); }
.cat-snippet { margin: -.3rem 0 .7rem; color: var(--muted); font-size: .95rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .88rem; font-weight: 600; }
.chip svg { opacity: .8; }
.chip-section { color: var(--ink); font-weight: 800; }
.chip-date { color: var(--brand); font-weight: 800; }
.cat-item-side { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; color: var(--muted); font-size: .85rem; font-weight: 600; text-align: right; line-height: 1.3; }
.cat-ago { display: flex; flex-direction: column; }
.cat-ago b { color: var(--ink); font-weight: 800; font-size: .92rem; }
.cat-ago i { font-style: normal; color: var(--muted); font-size: .8rem; font-weight: 600; }
.cat-arrow { color: var(--line-strong); display: inline-flex; }
.cat-item:hover .cat-arrow { color: var(--brand); }
.cat-empty { padding: 2rem 1.6rem; color: var(--muted); }
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.3rem; }
.cat-shown { color: var(--muted); font-weight: 600; }

.exam-list { background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; overflow: hidden; box-shadow: var(--shadow); }
.exam-row { display: flex; align-items: center; gap: 1.3rem; padding: 1.35rem 1.8rem; color: var(--ink) !important; text-decoration: none !important; }
.exam-row + .exam-row { border-top: 1px solid var(--line); }
.exam-row:hover { background: var(--hover); }
.exam-tile { display: inline-flex; align-items: center; justify-content: center; min-width: 3.9rem; height: 3.9rem; padding: 0 .5rem; border-radius: 1.1rem; color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.tone-0 { background: #2554ff; } .tone-1 { background: #f59e0b; } .tone-2 { background: #0ea5e9; }
.tone-3 { background: #10b981; } .tone-4 { background: #ef4444; } .tone-5 { background: #0d9488; }
.exam-info { display: flex; flex-direction: column; gap: .12rem; min-width: 0; flex: 1; }
.exam-info strong { font-size: 1.22rem; letter-spacing: -.015em; }
.exam-lead { color: var(--muted); font-size: 1rem; }
.exam-meta { color: var(--muted); font-size: .86rem; font-weight: 600; }
.exam-arrow, .subj-arrow { color: var(--line-strong); display: inline-flex; }
.exam-row:hover .exam-arrow, .subj-card:hover .subj-arrow { color: var(--brand); }

.subjects-band { margin-top: 5rem; padding: 4.2rem 0 4.6rem; background: var(--tint); }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem; }
.subj-card { display: flex; align-items: center; gap: 1rem; padding: .95rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.subj-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.subj-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.subj-text strong { font-size: 1.05rem; letter-spacing: -.01em; }
.subj-text small { color: var(--muted); font-weight: 600; }
.tile { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .95rem; background: color-mix(in srgb, var(--tile, #2554ff) 16%, var(--surface)); color: var(--tile, #2554ff); flex-shrink: 0; }
.tile svg { width: 1.45rem; height: 1.45rem; }
.tile-lg { width: 3.6rem; height: 3.6rem; border-radius: 1.1rem; }
.tile-solid { background: var(--tile); color: #fff; }

.tg-band { display: flex; align-items: center; gap: 1.4rem; padding: 1.7rem 2.2rem; background: var(--tg); color: #fff; border-radius: 1.6rem; }
.tg-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: rgba(255, 255, 255, .22); flex-shrink: 0; }
.tg-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.tg-text strong { font-size: 1.4rem; letter-spacing: -.02em; }
.tg-text span { opacity: .92; }
.tg-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .95rem 1.7rem; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .45); color: #fff !important; border-radius: 999px; font-weight: 800; text-decoration: none !important; white-space: nowrap; }
.tg-btn:hover { background: rgba(255, 255, 255, .32); }
.topic-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.topic-pill { padding: .65rem 1.1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink) !important; font-weight: 700; font-size: .95rem; text-decoration: none !important; }
.topic-pill:hover { border-color: var(--brand); color: var(--brand) !important; }
.topic-pill i { font-style: normal; color: var(--muted); font-weight: 700; margin-left: .3rem; font-size: .85em; }

/* ---------- подвал ---------- */
.site-footer { margin-top: 5rem; padding: 3.6rem 0 0; background: var(--navy); color: #9fabd0; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1.1fr .9fr 1.1fr; gap: 2.4rem; padding-bottom: 2.4rem; }
.footer-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.footer-logo { color: #fff; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.footer-col h3 { margin: 0 0 1rem; color: #fff; font-size: .85rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; }
.footer-col .rich-content p { margin: 0 0 .8rem; line-height: 1.6; }
.footer-nav { display: flex; flex-direction: column; gap: .7rem; }
.footer-nav a { color: #cdd5ee; font-weight: 500; }
.footer-nav a:hover { color: #fff; }
.footer-channel a, .footer-vpn a { color: #cdd5ee; }
.footer-grades { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer-grades a { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: .75rem; background: #1b2650; color: #fff; font-weight: 800; text-decoration: none; }
.footer-grades a:hover { background: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 1.3rem 24px 1.6rem; border-top: 1px solid #1b2650; font-size: .88rem; }

/* ---------- шапка страниц (хлебные крошки, заголовок, метки) ---------- */
.page-head { background: var(--tint); border-bottom: 1px solid var(--line); padding: 1.6rem 0 2.2rem; }
.crumbs, .breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.crumbs a, .breadcrumbs a { color: var(--muted); }
.crumbs a:hover, .breadcrumbs a:hover { color: var(--brand); text-decoration: none; }
.crumbs span.sep, .breadcrumbs span.sep { opacity: .5; }
.page-head h1, .page-title h1 { margin: 1.1rem 0 .6rem; font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
.page-lead { max-width: 46rem; margin: 0; color: var(--muted); font-size: 1.12rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px; font-weight: 800; font-size: .9rem; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink) !important; text-decoration: none !important; }
.pill-dark { background: var(--navy); border-color: var(--navy); color: #fff !important; }
.pill-peach { background: #ffe9d6; border-color: #ffe9d6; color: #7a3a00 !important; }
a.pill:hover { border-color: var(--brand); }
.page-body { padding-top: 2rem; }

/* старая разметка страниц (разделы, предметы, списки) в новом оформлении */
.breadcrumbs.container { padding-top: 1.4rem; }
.page-title.container { padding-top: .2rem; padding-bottom: .4rem; }
.latest.container { padding-top: 1.2rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.2rem; align-items: start; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; overflow: hidden; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.post-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.post-card-image { position: relative; width: 100%; height: 10rem; background-size: cover; background-position: center; background-color: var(--tint); }
.post-card-badge, .post-card-tag { align-self: flex-start; background: var(--brand-soft); color: var(--brand); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: .3rem .65rem; border-radius: .5rem; }
.post-card-badge { position: absolute; top: .7rem; left: .7rem; background: var(--yellow); color: #0b1230; }
.post-card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.2rem 1.2rem; flex: 1; }
.post-card-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.32; font-weight: 800; }
.post-card:hover h3 { color: var(--brand); }
.post-card-body p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-date { margin-top: auto; padding-top: .3rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; padding-top: 1.4rem; padding-bottom: 1rem; }
.subject-card { display: block; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; color: var(--ink) !important; text-decoration: none !important; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.subject-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.subject-card .tile { margin-bottom: .8rem; }
.subject-card-count { margin-top: .6rem !important; font-size: .85rem !important; font-weight: 700; }
.page-head + .subject-grid, .page-head + .latest.container, .page-head + .topics.container { padding-top: 2rem; }
.subject-card h3 { margin: .2rem 0 .3rem; font-size: 1.12rem; }
.subject-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.subject-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.1rem; height: 3.1rem; border-radius: 1rem; background: var(--brand-soft); font-size: 1.5rem; margin-bottom: .5rem; }
.stage-group { margin-bottom: 2rem; }
.stage-group-title { margin: 1.8rem 0 1rem; font-size: 1.5rem; font-weight: 800; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.filter-pill { display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink) !important; font-weight: 700; font-size: .92rem; text-decoration: none !important; }
.filter-pill:hover { border-color: var(--brand); }
.filter-pill.active { background: var(--navy); border-color: var(--navy); color: #fff !important; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination-info { color: var(--muted); font-weight: 600; }
.related { margin-top: 2rem; }
.related h2 { font-size: 1.35rem; margin: 1.6rem 0 .8rem; }
.related-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .5rem; }
.related-list a { display: block; padding: .85rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; color: var(--ink); font-weight: 600; }
.related-list a:hover { border-color: var(--brand); text-decoration: none; }
.related-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.topics-group { margin-bottom: 1.8rem; }
.topics-group h2 { margin: 0 0 .7rem; font-size: 1.25rem; }
.topics-group h2 a { color: var(--ink); }
.topics-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.topics-list a { padding: .5rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .92rem; }
.topics-list a:hover { border-color: var(--brand); text-decoration: none; }
.legal-page p { white-space: normal; }

/* ---------- текст разбора ---------- */
.rich-content { overflow-wrap: anywhere; }
.rich-content p { margin: 0 0 1rem; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.rich-content li { margin-bottom: .3rem; }
.rich-content a { text-decoration: underline; text-underline-offset: 3px; }
.rich-content blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.rich-content code { background: var(--tint); padding: .1rem .35rem; border-radius: .35rem; font-size: .9em; }
.rich-content pre { background: var(--tint); padding: .8rem 1rem; border-radius: .8rem; overflow-x: auto; }
.rich-content img { max-width: 100%; height: auto; border-radius: .9rem; display: block; margin: .3rem 0 1rem; }
.rich-content h2 { margin: 2rem 0 .8rem; font-size: 1.55rem; }
.rich-content h3 { margin: 1.5rem 0 .6rem; font-size: 1.2rem; }
.task-block { border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.3rem 1.5rem; margin: 1.4rem auto; background: var(--surface); }
.task-condition { background: var(--tint); padding: .9rem 1rem; border-radius: .8rem; margin: .8rem 0; }
.task-answer { margin-top: .9rem; padding: .8rem 1rem; border-left: 3px solid var(--brand); background: var(--tint); }
.post-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 1.4rem auto 0; border-radius: 1.2rem; overflow: hidden; }
.post-photo-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--tint); }
.inline-cta { max-width: 46rem; margin: 2rem auto; padding: 1.8rem 1.6rem; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: var(--shadow); }
.inline-cta p { margin: 0 0 1rem; color: var(--muted); }
.inline-cta .btn-primary { display: inline-flex; gap: .5rem; }
.vpn-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; padding: .9rem 1.2rem; border: 1px dashed var(--line-strong); border-radius: 1rem; color: var(--muted); font-size: .9rem; }
.vpn-note-text { display: flex; flex-direction: column; gap: .1rem; }
.vpn-note-text strong { color: var(--ink); }
.vpn-note .btn { flex-shrink: 0; padding: .5rem 1rem; font-size: .85rem; }

/* ---------- страница поиска ---------- */
.search-page { padding-top: 1.4rem; }
.search-big { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; padding: .45rem .45rem .45rem 1.2rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow); color: var(--muted); }
.search-big input { flex: 1; min-width: 0; border: none; background: none; outline: none; font: inherit; font-size: 1.12rem; color: var(--ink); padding: .7rem 0; }
.search-big button { border: none; border-radius: 999px; background: var(--brand); color: #fff; padding: .9rem 2rem; font: inherit; font-weight: 800; font-size: 1.02rem; cursor: pointer; }
.search-big button:hover { background: var(--brand-dark); }
.search-tabs { display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; margin: 1.1rem 0 .3rem; border-bottom: 1px solid var(--line); }
.search-tabs a { padding: .7rem 0 .8rem; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); font-weight: 800; text-decoration: none !important; }
.search-tabs a b { margin-left: .25rem; font-weight: 600; font-size: .85em; opacity: .8; }
.search-tabs a:hover { color: var(--ink); }
.search-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.search-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 1.4rem; }
.search-filters { position: sticky; top: calc(var(--header-h) + 1rem); padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: var(--shadow); }
.search-subjects { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 26rem; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.search-subj { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border: 1px solid transparent; border-radius: .85rem; color: var(--ink) !important; font-weight: 700; font-size: .95rem; text-decoration: none !important; }
.search-subj:hover { background: var(--hover); }
.search-subj.active { background: var(--brand-soft); border-color: var(--brand); }
.search-subj > span:nth-child(2) { flex: 1; min-width: 0; }
.search-subj b { color: var(--muted); font-size: .82rem; font-weight: 700; }
.search-subj-icon { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: .6rem; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.search-subj-icon svg { width: 1.1rem; height: 1.1rem; }
.search-results-head h1 { margin: 0 0 .9rem; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
.search-empty { padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; box-shadow: var(--shadow); }
.search-empty strong { font-size: 1.2rem; }
.search-empty p { margin: .6rem 0 1.2rem; color: var(--muted); }

/* ---------- страница материала ---------- */
.post-head { background: var(--tint); border-bottom: 1px solid var(--line); padding: 1.4rem 0 2rem; }
.post-head h1 { margin: 1.2rem 0 .8rem; font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.14; }
.post-lead { max-width: 48rem; margin: 0 0 1.3rem; color: var(--muted); font-size: 1.14rem; }
.post-lead p { margin: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; color: var(--muted); font-size: .92rem; font-weight: 600; }
.post-author { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 800; }
.post-author .avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--brand); color: #fff; }
.post-meta span.m { display: inline-flex; align-items: center; gap: .4rem; }
.post-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 17.5rem; gap: 1.6rem; align-items: stretch; padding-top: 1.8rem; }
.post-layout > .post-main { align-self: start; }
.facts-tg .btn { flex-shrink: 0; white-space: nowrap; }
.side-sticky { position: sticky; top: calc(var(--header-h) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.side-card { padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.3rem; box-shadow: var(--shadow); }
.side-card h2, .side-card h3 { margin: 0 0 .8rem; font-size: 1rem; font-weight: 800; }
.toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; counter-reset: toc; }
.toc a { display: flex; gap: .7rem; padding: .5rem .5rem; border-radius: .6rem; color: var(--ink); font-size: .9rem; font-weight: 600; line-height: 1.35; text-decoration: none !important; counter-increment: toc; }
.toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font-weight: 700; font-size: .78rem; padding-top: .12rem; flex-shrink: 0; }
.toc a:hover, .toc a.active { background: var(--brand-soft); color: var(--brand); }
.toc li.sub a { padding-left: 1.4rem; font-weight: 500; }
details.toc-mobile { display: none; }
.post-layout.no-toc { grid-template-columns: minmax(0, 1fr) 17.5rem; }
.post-main { min-width: 0; }
.post-main > .article + *, .post-main > .inline-cta { margin-top: 1.4rem; }
.post-main .inline-cta { max-width: none; margin-left: 0; margin-right: 0; }
.post-main .vpn-note { margin-top: 1.6rem; }
.post-main .related { margin-top: 1rem; }
.pill-links .pill svg, .pill svg { flex-shrink: 0; }
.article { min-width: 0; padding: 2rem 2.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.6rem; box-shadow: var(--shadow); font-size: 1.06rem; line-height: 1.7; }
.article > :first-child { margin-top: 0; }
.article h2 { scroll-margin-top: 90px; }
.article h3 { scroll-margin-top: 90px; }
.article .post-photo-grid { margin-top: 0; margin-bottom: 1.4rem; }
.side-subject { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.side-subject strong { font-size: 1.1rem; }
.side-links { display: flex; flex-direction: column; gap: .2rem; }
.side-links a { display: flex; align-items: center; justify-content: space-between; padding: .55rem .2rem; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .92rem; text-decoration: none !important; }
.side-links a:hover { color: var(--brand); }
.side-tg { display: flex; flex-direction: column; gap: .5rem; }
.side-tg .row { display: flex; align-items: center; gap: .7rem; }
.side-tg .ico-circle { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--tg); color: #fff; flex-shrink: 0; }
.side-tg strong { display: block; font-size: .98rem; }
.side-tg small { color: var(--muted); font-size: .78rem; }
.side-tg p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.btn-block { display: flex; width: 100%; }
.post-below { padding-top: 1.4rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0 0; }
.post-tags a { padding: .5rem 1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-weight: 700; font-size: .88rem; text-decoration: none !important; }
.post-tags a:hover { border-color: var(--brand); color: var(--brand); }
.author-card { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; padding: 1.2rem 1.4rem; background: var(--tint); border-radius: 1.3rem; }
.author-card .avatar { display: inline-flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--brand); color: #fff; flex-shrink: 0; }
.author-card strong { display: block; }
.author-card span { color: var(--muted); font-size: .9rem; }
.facts-card { margin-top: 1.4rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.5rem; box-shadow: var(--shadow); }
.facts-card h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .7rem; }
.fact { padding: .8rem 1rem; background: var(--tint); border-radius: .9rem; }
.fact small { display: block; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.fact b { display: block; margin-top: .15rem; font-size: .98rem; }
.facts-grades { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.facts-grades .g { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .5rem; border-radius: .6rem; background: var(--navy); color: #fff; letter-spacing: 0; }
.facts-tg { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: .9rem 1.1rem; background: #e3f3fc; border-radius: 1rem; color: #0b3a52; font-weight: 600; }
:root[data-theme="dark"] .facts-tg { background: #17384a; color: #cfeaf8; }
.block-title { margin: 2.4rem 0 1rem; font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.region-card { margin-top: 1.2rem; padding: 1.2rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.3rem; box-shadow: var(--shadow); }
.region-card h3 { margin: 0 0 .7rem; font-size: 1.05rem; }
.region-card a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none !important; }
.region-card a:first-of-type { border-top: none; }
.region-card a:hover { color: var(--brand); }
.pill-links { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- плавающие кнопки Telegram ---------- */
.float-tg { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 60; display: flex; align-items: center; gap: .8rem; padding: .75rem 1.3rem .75rem .8rem; background: var(--tg); color: #fff !important; border-radius: 999px; box-shadow: 0 12px 30px rgba(10, 80, 130, .35); text-decoration: none !important; }
.float-tg:hover { background: var(--tg-dark); }
.float-tg .ico-circle { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(255, 255, 255, .22); flex-shrink: 0; }
.float-tg strong { display: block; font-size: .98rem; line-height: 1.15; }
.float-tg small { display: block; font-size: .74rem; opacity: .9; line-height: 1.2; }
.toast-tg { position: fixed; right: 1.4rem; bottom: 6rem; z-index: 61; width: 21rem; max-width: calc(100vw - 2rem); padding: 1.1rem 1.2rem 1.2rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 1.3rem; box-shadow: var(--shadow-lg); transform: translateY(10px); opacity: 0; transition: opacity .25s, transform .25s; }
.toast-tg.show { opacity: 1; transform: none; }
.toast-tg .row { display: flex; gap: .8rem; align-items: flex-start; }
.toast-tg .ico-circle { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--tg); color: #fff; flex-shrink: 0; }
.toast-tg strong { display: block; font-size: 1rem; }
.toast-tg p { margin: .2rem 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.toast-tg .btn { margin-top: .9rem; }
.toast-close { position: absolute; top: .6rem; right: .6rem; display: inline-flex; width: 1.8rem; height: 1.8rem; align-items: center; justify-content: center; border: none; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.toast-close:hover { background: var(--hover); }

/* ---------- прочие страницы ---------- */
.prose-page { padding-top: 2rem; padding-bottom: 1rem; }
.prose-card { max-width: 52rem; padding: 2rem 2.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.6rem; box-shadow: var(--shadow); }
.about h2 { margin-top: 0; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .post-layout { grid-template-columns: 14rem minmax(0, 1fr); }
  .post-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
  .post-layout .side-right { grid-column: 1 / -1; }
  .post-layout .side-right .side-sticky { position: static; flex-direction: row; flex-wrap: wrap; }
  .post-layout .side-right .side-card { flex: 1 1 18rem; }
}
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; padding-bottom: 6rem; }
  .hero-art { display: none; }
}
@media (max-width: 960px) {
  .top-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-search-btn { margin-left: auto; }
  .mobile-only { display: flex !important; }
  .main-nav { grid-template-columns: 1fr; gap: 0; }
  .main-nav.open { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; width: auto; margin: 0; padding: .3rem 20px 1.5rem; border: none; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; overflow-y: auto; align-content: start; }
  .main-nav-item { border-bottom: 1px solid var(--line); border-radius: 0; padding: .9rem .3rem; }
  .catalog-layout, .search-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .cat-sort { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .cat-sort::-webkit-scrollbar { display: none; }
  .cat-sort a { white-space: nowrap; padding: .55rem .9rem; }
  .cat-filters-btn { display: inline-flex; }
  .cat-filters { display: none; position: static; }
  .cat-filters.open { display: block; }
  .search-filters { position: static; }
  .search-subjects { max-height: 15rem; }
  .post-layout, .post-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
  .post-layout .side-left { display: none; }
  details.toc-mobile { display: block; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1.2rem; padding: .9rem 1.2rem; }
  details.toc-mobile summary { cursor: pointer; font-weight: 800; }
  details.toc-mobile .toc { margin-top: .7rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 4.1rem; }
  .container { padding: 0 16px; }
  .header-inner { gap: .5rem; padding: .7rem 16px; }
  .cta-tg { display: none; }
  .logo { font-size: 1.25rem; }
  .logo-mark { width: 2.5rem; height: 2.5rem; }
  .header-search-btn, .theme-toggle, .nav-toggle { width: 2.6rem; height: 2.6rem; }
  .hero-grid { padding-top: 2.4rem; padding-bottom: 5.4rem; }
  .hero-copy h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .hero-copy h1.hero-title-long { font-size: clamp(1.9rem, 9vw, 2.5rem); }
  .hero-sub { font-size: 1.05rem; }
  .hero-search { padding: .35rem; }
  .hero-search-field { padding-left: .8rem; }
  .hero-search button { padding: .9rem 1.2rem; }
  .soon-card { flex-direction: column; align-items: flex-start; padding: 1.4rem; }
  .soon-btn { width: 100%; }
  .home-block { padding-top: 3.4rem; }
  .cat-item { flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1.1rem 1.2rem; }
  .cat-item-side { width: 100%; justify-content: space-between; }
  .cat-ago { flex-direction: row; gap: .4rem; }
  .exam-row { padding: 1.1rem 1.2rem; gap: .9rem; }
  .exam-tile { min-width: 3.3rem; height: 3.3rem; }
  .subjects-band { padding: 3rem 0 3.2rem; }
  .tg-band { flex-wrap: wrap; padding: 1.4rem; }
  .tg-btn { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .article { padding: 1.3rem 1.2rem; border-radius: 1.3rem; font-size: 1.02rem; }
  .search-big { padding-left: .9rem; }
  .search-big button { padding: .85rem 1.2rem; }
  .search-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 1.2rem; white-space: nowrap; }
  .float-tg { left: .8rem; right: .8rem; bottom: .8rem; padding: .7rem 1rem .7rem .8rem; }
  .toast-tg { left: .8rem; right: .8rem; bottom: 5.4rem; width: auto; }
  .prose-card { padding: 1.4rem 1.2rem; }
  .vpn-note { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .facts-tg { flex-direction: column; align-items: stretch; text-align: center; }
  .facts-tg .btn { white-space: normal; }
}

/* ---------- редактор (автор): аватарка, карточка, страница ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; flex-shrink: 0; object-fit: cover; overflow: hidden; }
img.avatar { background: #000; }
.avatar-lg { width: 3.4rem; height: 3.4rem; font-size: 1.3rem; }
.avatar-xl { width: 7.5rem; height: 7.5rem; font-size: 3rem; box-shadow: 0 8px 24px rgba(15, 23, 60, .18); }
.post-author:hover { color: var(--brand); text-decoration: none; }
a.author-card { color: var(--ink); text-decoration: none !important; transition: background .15s; }
a.author-card:hover { background: var(--brand-soft); }
a.author-card > div { flex: 1; min-width: 0; }
.author-card-more { display: inline-flex; align-items: center; gap: .35rem; color: var(--brand); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.author-hero { display: flex; align-items: center; gap: 1.8rem; margin-top: 1.2rem; }
.author-hero-text h1 { margin: 0 0 .3rem; }
.author-role { margin: 0 0 .5rem; color: var(--brand); font-weight: 800; }
.author-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: 1rem; color: var(--muted); font-weight: 600; }
.author-stats b { color: var(--ink); font-size: 1.15rem; }
.author-list { padding-top: 2rem; padding-bottom: 1rem; }
@media (max-width: 640px) {
  .author-hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .avatar-xl { width: 6rem; height: 6rem; font-size: 2.4rem; }
  .author-card-more { display: none; }
}