/* ═══════════════════════════════════════════════════════════════
   tests-tests.ru — design.css (v1562)
   Слой современного оформления поверх style.css.

   Принципы:
   — полная ширина на широких экранах (до 2200px), плавная сетка;
   — объём: многослойные тени, градиенты, «клавиши» с эффектом нажатия;
   — цвет раздела (--accent / --accent-soft / --top-section-accent) и тема
     шапки из админки (--hero-grad / --nav-bg) НЕ переопределяются —
     слой только использует эти переменные;
   — три режима: телефон (≤680), планшет (681–1024), компьютер (≥1025).
   Файл подключается сразу после style.css в includes/header.php.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Токены ─────────────────────────────────────────────── */
:root {
  --page-max: 2200px;
  --page-pad: clamp(14px, 2.2vw, 40px);
  --sidebar-w: 264px;
  --nav-h: 64px;

  --ink:        #15172b;
  --ink-soft:   #363a57;
  --ink-muted:  #62678a;
  --ink-light:  #8a8fae;
  --paper:      #eef1f8;
  --paper-warm: #e6eaf5;
  --border:     #e1e5f1;
  --border-str: #c9cfe2;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(22,28,60,.06), 0 1px 1px rgba(22,28,60,.04);
  --shadow:    0 1px 2px rgba(22,28,60,.05), 0 4px 10px rgba(22,28,60,.05), 0 12px 28px rgba(22,28,60,.06);
  --shadow-lg: 0 2px 4px rgba(22,28,60,.05), 0 10px 22px rgba(22,28,60,.08), 0 28px 56px rgba(22,28,60,.12);
  --shadow-xl: 0 4px 8px rgba(22,28,60,.06), 0 18px 36px rgba(22,28,60,.12), 0 44px 80px rgba(22,28,60,.16);

  --surface-grad: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --key-depth: 4px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --sans: system-ui, 'Segoe UI', -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

@media (max-width: 680px) { :root { --nav-h: 56px; } }

/* ─── 2. База ───────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    linear-gradient(180deg, #f3f5fb 0%, #ecf0f8 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 15px;
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
#tt-main { display: block; height: 0; outline: none; }
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 3000;
  background: #fff; color: var(--ink) !important; font-weight: 600;
  padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  transition: top .15s;
}
.skip-link:focus { top: 10px; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, #fff); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, #fff); }

/* ─── 3. Шапка ──────────────────────────────────────────────── */
body .site-header {
  height: var(--nav-h);
  padding: 0 var(--page-pad);
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 10px 30px rgba(6,16,42,.28);
  transition: box-shadow .25s var(--ease);
}
body .site-header::after {
  /* мягкий блик поверх темы шапки — добавляет глубину, не меняя её цвет */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 55%, rgba(0,0,0,.10) 100%);
}
body.is-scrolled .site-header { box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 14px 40px rgba(6,16,42,.42); }
body .site-header-inner {
  position: relative; z-index: 1;
  max-width: var(--page-max); margin: 0 auto;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: clamp(8px, 1.2vw, 20px);
}
body .site-header-brand   { grid-column: 1; }
body .site-header-search  { grid-column: 2; justify-self: stretch; }
body .site-header-actions { grid-column: 3; }
body .site-header-brand {
  min-height: 42px; padding: 8px 14px 8px 10px; gap: 9px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: -.02em;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px rgba(0,0,0,.18);
  transition: transform .18s var(--ease), background .18s;
}
body .site-header-brand .brand-icon {
  width: 28px; height: 28px; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #ffffff, #dfe8ff);
  border-radius: 9px;
  box-shadow: 0 2px 0 rgba(0,0,0,.18), inset 0 1px 0 #fff;
}

body .site-header-search {
  width: 100% !important; max-width: none !important; min-width: 0 !important; height: 44px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 8px 22px rgba(0,0,0,.20), inset 0 2px 4px rgba(22,28,60,.08);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
body .site-header-search:focus-within {
  box-shadow: 0 12px 30px rgba(0,0,0,.28), 0 0 0 4px rgba(255,255,255,.28), inset 0 2px 4px rgba(22,28,60,.06);
}
.site-header-search-icon { padding-left: 14px; font-size: 15px; opacity: .65; flex-shrink: 0; }
body .site-header-search input { padding: 0 8px 0 10px; font-size: 14.5px; color: var(--ink); font-family: var(--sans); }
body .site-header-search input::placeholder { color: #7b829f; }
body .site-header-search input::-webkit-search-cancel-button { cursor: pointer; }
.site-header-search-kbd {
  flex-shrink: 0; margin-right: 8px;
  font: 600 11px/1 var(--mono, monospace); color: #7b829f;
  border: 1px solid #d5daea; border-bottom-width: 2px; border-radius: 6px;
  padding: 4px 7px; background: #f6f8fd;
}
.site-header-search:focus-within .site-header-search-kbd { display: none; }
body .site-header-search button {
  width: auto; height: calc(100% - 8px); margin-right: 4px; padding: 0 16px;
  border-radius: 10px;
  font: 600 13.5px/1 var(--sans); color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff) 0%, var(--accent) 100%);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 65%, #000), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
body .site-header-search button:hover { filter: brightness(1.06); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff) 0%, var(--accent) 100%); }

body .btn-vk-login {
  min-height: 42px; padding: 8px 16px; border-radius: 14px; font-size: 13.5px;
  transition: transform .15s var(--ease), background .15s;
}

@media (max-width: 1024px) { .site-header-search-kbd { display: none; } }
@media (max-width: 680px) {
  body .site-header { padding: 0 10px; }
  body .site-header-inner { gap: 8px; }
  body .site-header-brand { max-width: none !important; padding: 6px; min-height: 40px; overflow: visible; background: transparent; border-color: transparent; box-shadow: none; }
  body .site-header-brand .brand-text { display: none !important; }
  body .site-header-brand .brand-icon { width: 36px; height: 36px; font-size: 19px; border-radius: 11px; }
  body .site-header-search { height: 40px; border-radius: 12px; }
  body .site-header-search input { font-size: 16px; /* iOS не увеличивает страницу при фокусе */ }
  .site-header-search-icon { padding-left: 11px; }
  body .site-header-search button { padding: 0 12px; font-size: 13px; }
  body .btn-vk-login { min-height: 40px; min-width: 40px; padding: 8px 11px; border-radius: 12px; justify-content: center; }
  body .btn-vk-login > span:not(.btn-vk-user-name) { display: none; }
  body .btn-vk-user .btn-vk-user-name { display: none; }
  body .btn-vk-user > span { display: inline !important; }
}
@media (max-width: 380px) {
  body .site-header-search button { display: none; }
}

/* ─── 4. Hero ───────────────────────────────────────────────── */
body .hero-compact,
body .hero,
body .hero.hero-page-compact {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(22px, 2.6vw, 44px) var(--page-pad) clamp(22px, 2.4vw, 40px) !important;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.08), 0 18px 40px -22px rgba(10,18,50,.55);
}
/* объёмные световые пятна и сетка — поверх фона темы/раздела */
body .hero-compact::before,
body .hero::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: -40%; right: -8%; left: auto; bottom: auto;
  width: min(60vw, 900px); height: min(60vw, 900px); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.20), rgba(255,255,255,.05) 40%, transparent 68%);
  filter: blur(2px);
}
body .hero-compact::after,
body .hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  width: auto; height: auto; border-radius: 0; top: 0; left: 0; bottom: 0;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(4,10,30,.34) 100%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 100%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 30%, transparent 100%);
}

body .hero-compact-inner,
body .hero-inner { max-width: var(--page-max) !important; width: 100%; margin: 0 auto; display: block; }
body .hero-compact-text { max-width: none !important; width: 100%; margin: 0 !important; padding: 0 !important; }

/* Главная */
.hero-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
body .hero-home .hero-compact-title {
  font-size: clamp(26px, 3.1vw, 46px) !important; line-height: 1.1; letter-spacing: -.02em; font-weight: 700;
  margin: 0; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.22);
}
body .hero-home .hero-compact-lead { font-size: clamp(14px, 1.2vw, 18px) !important; margin: 10px 0 0 !important; color: rgba(255,255,255,.86) !important; max-width: 60ch; }
.hero-home-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 112px; padding: 12px 16px;
  color: #fff !important; text-decoration: none !important;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.20), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 24px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .2s var(--ease);
}
.hero-stat-num { font-family: var(--sans); font-size: clamp(20px, 1.8vw, 28px); font-weight: 700; line-height: 1; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.hero-stat-label { font-size: 12px; color: rgba(255,255,255,.78); }
body .hero-home .hero-trust-markers { margin: 16px 0 0 !important; gap: 8px; justify-content: flex-start; }
body .hero-trust-item {
  padding: 5px 12px 5px 8px; font-size: 12.5px; font-weight: 600; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
body .hero-trust-icon {
  width: 17px; height: 17px; font-size: 10px; font-weight: 700; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #5eead4, #10b981); color: #05382b;
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}

/* Плитки разделов (главная) */
.section-tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: clamp(18px, 2vw, 28px);
  perspective: 1200px;
}
.section-tile {
  --tile-color: #5c4ee8;
  position: relative; display: flex; flex-direction: column; gap: 10px;
  min-height: 132px; padding: 14px 14px 13px;
  color: #fff !important; text-decoration: none !important;
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.34), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--tile-color) 88%, #fff) 0%, var(--tile-color) 55%, color-mix(in srgb, var(--tile-color) 72%, #000) 100%);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -3px 0 rgba(0,0,0,.14),
    0 6px 0 color-mix(in srgb, var(--tile-color) 55%, #000),
    0 18px 30px -8px rgba(0,0,0,.45);
  transform: translateY(0);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), filter .16s;
  overflow: hidden;
}
.section-tile::after {
  content: ''; position: absolute; right: -28px; bottom: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); pointer-events: none;
}
.section-tile:hover { filter: saturate(1.08) brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.14), 0 10px 0 color-mix(in srgb, var(--tile-color) 55%, #000), 0 28px 40px -10px rgba(0,0,0,.5); }
.section-tile.active { outline: 3px solid rgba(255,255,255,.85); outline-offset: 2px; }
.section-tile-icon {
  width: 46px; height: 46px; font-size: 25px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.80));
  box-shadow: 0 3px 0 rgba(0,0,0,.16), 0 8px 14px rgba(0,0,0,.18), inset 0 1px 0 #fff;
}
.section-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; z-index: 1; }
.section-tile-name { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.section-tile-hint { font-size: 12px; line-height: 1.3; color: rgba(255,255,255,.88); text-shadow: 0 1px 1px rgba(0,0,0,.2); }
.section-tile-sub { display: none; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.9); font-variant-numeric: tabular-nums; }
.section-tile-count {
  white-space: nowrap;
  position: absolute; top: 12px; right: 12px; z-index: 1;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(8,12,30,.30); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.section-tile-school, .section-tile-school .section-tile-hint, .section-tile-school .section-tile-sub { color: #2a1c00 !important; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.section-tile-school .section-tile-count { background: rgba(60,36,0,.72); color: #fff; text-shadow: none; }

@media (max-width: 1500px) { .section-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .section-tile { min-height: 0; flex-direction: row; align-items: center; } .section-tile-count { position: static; margin-left: auto; align-self: flex-start; } }
@media (max-width: 900px)  { .section-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 680px)  {
  .section-tile { padding: 11px 11px 10px; border-radius: 16px; gap: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(0,0,0,.14), 0 4px 0 color-mix(in srgb, var(--tile-color) 55%, #000), 0 12px 20px -8px rgba(0,0,0,.45); }
  .section-tile-icon { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
  .section-tile-name { font-size: 14.5px; }
  .section-tile-hint { display: none; }
  .section-tile-sub { display: block; }
  .section-tile-count { display: none; }
  .hero-home-stats { width: 100%; }
  .hero-stat { flex: 1 1 0; min-width: 0; padding: 10px 12px; }
}

/* Внутренние страницы: hero + цветные «таблетки» разделов */
body .hero .breadcrumb { margin-bottom: 10px; font-size: 13px; }
body .hero-cat-title { font-size: clamp(24px, 2.6vw, 40px) !important; font-weight: 700; letter-spacing: -.015em; line-height: 1.1; text-shadow: 0 6px 18px rgba(0,0,0,.25); }
body .hero-desc { max-width: 90ch; font-size: clamp(14px, 1.05vw, 16.5px); line-height: 1.6; color: rgba(255,255,255,.88); }
body .top-section-menu.top-section-menu {
  display: flex; flex-wrap: wrap; justify-content: flex-start !important;
  gap: 8px !important; margin: 18px 0 0 !important; padding: 0 0 6px !important;
  max-width: none !important; width: 100%;
  overflow: visible;
}
body .top-section-pill.top-section-pill {
  --pill-color: #5c4ee8;
  display: inline-flex !important; align-items: center; gap: 7px;
  min-height: 40px !important; padding: 8px 18px 9px !important;
  font-size: 13.5px !important; font-weight: 600 !important; line-height: 1; white-space: nowrap;
  color: #fff !important; text-decoration: none !important;
  border-radius: 13px !important;
  border: 1px solid rgba(255,255,255,.26) !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pill-color) 84%, #fff) 0%, var(--pill-color) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 0 color-mix(in srgb, var(--pill-color) 58%, #000), 0 10px 18px -6px rgba(0,0,0,.4) !important;
  transform: none !important;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .15s !important;
}
body .top-section-pill.top-section-pill:hover { filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 5px 0 color-mix(in srgb, var(--pill-color) 58%, #000), 0 16px 22px -8px rgba(0,0,0,.45) !important; }
body .top-section-pill.top-section-pill.active { outline: 2.5px solid #fff; outline-offset: 2px; }
body .top-section-pill.top-section-pill-school { color: #2a1c00 !important; }
/* планшет и телефон: все восемь разделов видны сразу, без горизонтальной прокрутки */
@media (max-width: 1024px) {
  body .top-section-menu.top-section-menu { flex-wrap: wrap !important; overflow: visible !important; gap: 8px !important; }
}
@media (max-width: 680px) {
  body .top-section-menu.top-section-menu { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px !important; margin-top: 14px !important; }
  body .top-section-pill.top-section-pill { justify-content: center; min-height: 38px !important; padding: 7px 4px 8px !important; font-size: 12.5px !important; border-radius: 11px !important; min-width: 0; }
  body .top-section-pill .tsp-label { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 430px) {
  /* 3 + 3 + 2: длинные названия («Развлечения») помещаются целиком */
  body .top-section-menu.top-section-menu { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body .top-section-pill.top-section-pill { grid-column: span 2; }
  body .top-section-pill.top-section-pill:nth-child(7), body .top-section-pill.top-section-pill:nth-child(8) { grid-column: span 3; }
}

/* Результат: шапка выровнена по общей ширине страницы */
body .result-hero { padding-left: var(--page-pad); padding-right: var(--page-pad); }
body .result-hero-inner { max-width: var(--page-max); }

body .cta-block { border-radius: 20px; border-color: #fff; min-width: 0; }
@media (max-width: 520px) { .result-cta-grid { grid-template-columns: 1fr !important; } }

@media (max-width: 600px) { .about-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* Профиль: шапка выровнена по общей ширине страницы */
body .profile-page-hero { padding-left: var(--page-pad); padding-right: var(--page-pad); }
body .profile-page-hero-inner { max-width: var(--page-max); }

/* ─── 5. Каркас: сайдбар + контент на всю ширину ───────────── */
body .page-layout,
body .result-layout {
  max-width: var(--page-max) !important;
  padding: clamp(16px, 1.6vw, 28px) var(--page-pad) 72px !important;
  gap: clamp(16px, 1.6vw, 28px);
  align-items: flex-start;
}
body .main-area { min-width: 0; flex: 1 1 auto; }
body .container { max-width: var(--page-max); padding: 0 var(--page-pad); }
body .main-area > .container, body .main-area > .container-sm { margin-left: 0; padding-left: 0 !important; padding-right: 0 !important; }

body .sidebar {
  width: var(--sidebar-w);
  top: calc(var(--nav-h) + 16px) !important;
  max-height: calc(100vh - var(--nav-h) - 32px) !important;
  padding: 14px 10px !important;
  background: var(--surface-grad);
  border: 1px solid #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow), 0 0 0 1px rgba(22,28,60,.05);
  scrollbar-width: thin;
}
body .sidebar-label {
  font-family: var(--sans); font-size: 11px; letter-spacing: .09em; font-weight: 700;
  color: var(--ink-light); padding: 6px 12px 8px;
}
body .sidebar-label-current { color: var(--accent); }
body .sidebar-mini-label { font-family: var(--sans); }
body .sidebar-item {
  gap: 10px; padding: 8px 10px; margin-bottom: 2px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  border-radius: 12px; min-height: 40px;
  transition: background .14s, color .14s, transform .14s var(--ease), box-shadow .14s;
}
body .sidebar-item .si-icon {
  width: 28px; min-width: 28px; height: 28px; font-size: 16px;
  border-radius: 9px;
  background: linear-gradient(160deg, #ffffff, #eef1f9);
  box-shadow: 0 1px 0 rgba(22,28,60,.10), 0 2px 5px rgba(22,28,60,.07), inset 0 1px 0 #fff;
}
body .sidebar-item:hover { background: var(--accent-soft); color: var(--ink); }
body .sidebar-item.active,
body .sidebar-group.active > .sidebar-parent {
  color: var(--ink); font-weight: 600;
  background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, #fff));
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(22,28,60,.05);
}
body .sidebar-divider { margin: 10px 12px; background: linear-gradient(90deg, transparent, var(--border-str), transparent); }
body .sidebar-parent .si-arrow { font-size: 18px; color: var(--ink-light); }
body .sidebar-submenu {
  min-width: 260px; padding: 10px;
  border-radius: 18px; border: 1px solid #fff; border-left: 1px solid #fff;
  background: var(--surface-grad);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(22,28,60,.06);
}
body .sidebar-submenu::after { background: #fff; border-color: rgba(22,28,60,.08); }

body .mobile-sidebar-bar,
body .search-bar-wrap.catalog-menu-wrap { display: none; }
body .mobile-sidebar-btn,
body .sidebar-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 46px; padding: 10px 16px;
  font: 600 14.5px/1 var(--sans); color: var(--ink);
  background: var(--surface-grad);
  border: 1px solid #fff; border-radius: 14px;
  box-shadow: 0 var(--key-depth) 0 #cfd5e6, var(--shadow);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}

/* на странице теста под шапкой закреплена полоса прогресса — меню начинается ниже неё */
@media (min-width: 1025px) {
  body.page-test .sidebar { top: calc(var(--nav-h) + 74px) !important; max-height: calc(100vh - var(--nav-h) - 90px) !important; }
}

/* Планшет и телефон: сайдбар — выдвижная панель */
@media (max-width: 1024px) {
  body .page-layout, body .result-layout { display: block; padding-top: 14px !important; }
  body .main-area { width: 100%; }
  body .mobile-sidebar-bar,
  body .search-bar-wrap.catalog-menu-wrap {
    display: block; position: static; padding: 0 0 14px; margin: 0;
    background: transparent; border: 0; box-shadow: none;
  }
  body .search-bar-inner { padding: 0; max-width: none; }
  body .sidebar {
    position: fixed !important; top: 0 !important; left: 0; bottom: 0;
    width: min(340px, 88vw); max-height: none !important; height: 100%;
    z-index: 2100; margin: 0;
    padding: calc(var(--nav-h) + 6px) 12px calc(24px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 24px 24px 0; border: 0;
    overflow-y: auto; overflow-x: hidden;
    transform: translateX(-105%);
    transition: transform .28s var(--ease);
    box-shadow: var(--shadow-xl);
  }
  body .sidebar.open { transform: translateX(0); }
  body .sidebar-close {
    display: flex !important; align-items: center; justify-content: center;
    position: absolute !important; top: 12px !important; right: 12px !important;
    width: 40px; height: 40px; padding: 0 !important; font-size: 18px !important;
    background: var(--paper) !important; border-radius: 12px; color: var(--ink) !important;
  }
  body .sidebar-overlay { z-index: 2050; background: rgba(10,14,34,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  body .sidebar-overlay.visible { display: block; }
  body .sidebar-item { min-height: 44px; font-size: 15px; }
  body .sidebar-group { position: static; }
  body .sidebar-parent .si-arrow { transform: rotate(90deg); }
  body .sidebar-submenu {
    display: block; position: static; min-width: 0; max-height: none;
    margin: 0 4px 8px 24px; padding: 2px 0 2px 10px;
    background: transparent; border: 0; border-left: 2px solid var(--border);
    border-radius: 0; box-shadow: none;
  }
  body .sidebar-submenu::before, body .sidebar-submenu::after { display: none; }
  body .sidebar-subitem { min-height: 40px; font-size: 14px; }
}

/* ─── 6. Панель списка тестов ───────────────────────────────── */
body .tests-section { padding: 0 !important; max-width: none; }
body .tests-section-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  margin: 0 0 clamp(14px, 1.4vw, 22px); padding: 0;
}
.tests-toolbar-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
body .section-title { font-size: clamp(20px, 1.7vw, 28px); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; color: var(--ink); }
body .section-count {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink-muted);
  padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sort-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #e3e8f3; border-radius: 15px;
  box-shadow: inset 0 2px 4px rgba(22,28,60,.10), 0 1px 0 #fff;
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.sort-tabs::-webkit-scrollbar { display: none; }
body .sort-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  min-height: 38px; padding: 8px 14px;
  font: 600 13.5px/1 var(--sans); color: var(--ink-muted) !important; text-decoration: none !important; white-space: nowrap;
  background: transparent; border: 0; border-radius: 11px; box-shadow: none;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
}
body .sort-tab:hover { color: var(--ink) !important; background: rgba(255,255,255,.6); }
body .sort-tab.active {
  color: var(--ink) !important;
  background: linear-gradient(180deg, #fff, #f7f9ff);
  box-shadow: 0 2px 0 #cdd3e4, 0 4px 10px rgba(22,28,60,.10), inset 0 0 0 1px #fff;
}
body .search-results-note {
  margin: -4px 0 16px; padding: 10px 14px; font-size: 14px; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm);
}
@media (max-width: 680px) {
  .sort-tabs { width: 100%; }
  body .sort-tab { padding: 8px 12px; font-size: 13px; }
}

/* ─── 7. Сетка и карточка теста ─────────────────────────────── */
body .tests-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)) !important;
  gap: clamp(12px, 1.2vw, 20px) !important;
  max-width: none !important; margin: 0 !important; padding: 0 !important;
}
body .test-card {
  --cat-color: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 0;
  height: 100%; min-width: 0;
  padding: 18px 16px 16px !important;
  color: var(--ink); text-decoration: none !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cat-color) 7%, #fff) 0%, #fff 110px),
    #fff;
  border: 1px solid #fff !important;
  border-radius: var(--radius-xl) !important;
  box-shadow:
    0 0 0 1px rgba(22,28,60,.06),
    0 5px 0 color-mix(in srgb, var(--cat-color) 16%, #dfe4f0),
    0 14px 28px -10px rgba(22,28,60,.18);
  transform: translateY(0);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  overflow: hidden;
}
body .test-card::before {
  /* цветная кромка категории */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; width: auto;
  background: linear-gradient(90deg, var(--cat-color), color-mix(in srgb, var(--cat-color) 55%, #fff));
  border-radius: 0; opacity: 1;
}
body .test-card:hover {
  text-decoration: none !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cat-color) 30%, transparent),
    0 9px 0 color-mix(in srgb, var(--cat-color) 22%, #dfe4f0),
    0 30px 44px -14px color-mix(in srgb, var(--cat-color) 30%, rgba(22,28,60,.30));
}
body .test-card:focus-visible { outline: 3px solid var(--cat-color); outline-offset: 3px; }

body .tc-cat-label {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%;
  margin: 2px 0 12px; padding: 0;
  font: 700 11.5px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: color-mix(in srgb, var(--cat-color) 78%, #15172b);
  background: none; border: 0;
}
body .tc-cat-icon {
  width: 34px; height: 34px; font-size: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(160deg, #fff, color-mix(in srgb, var(--cat-color) 16%, #fff));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--cat-color) 28%, #d8deec), 0 6px 12px -4px color-mix(in srgb, var(--cat-color) 40%, transparent), inset 0 1px 0 #fff;
}
body .tc-title {
  font-size: 16.5px; font-weight: 700; line-height: 1.28; letter-spacing: -.015em; color: var(--ink);
  margin: 0 0 8px;
}
body .tc-desc {
  font-size: 13.5px; line-height: 1.5; color: var(--ink-muted); margin: 0 0 14px;
}
/* обрезка по строкам — на внутреннем span: сам абзац является flex-элементом карточки */
.tc-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
body .tc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; align-items: center; min-width: 0; }
body .test-card .tc-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  min-height: 25px; padding: 3px 7px;
  font: 600 11.5px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap;
  border-radius: 9px; border-width: 1px; border-style: solid;
}
body .test-card .tc-badge .tc-meta-icon { font-size: 12px; }
body .test-card .tc-difficulty-dot {
  flex: 0 0 auto; width: 12px; height: 12px; margin: 0 3px 0 1px; border-radius: 50%;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(22,28,60,.10), 0 2px 4px rgba(22,28,60,.2);
}
body .tc-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin-top: 14px; padding: 11px 14px;
  font: 700 14px/1 var(--sans); color: color-mix(in srgb, var(--cat-color) 80%, #15172b);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--cat-color) 8%, #fff));
  border: 1px solid color-mix(in srgb, var(--cat-color) 28%, #e1e5f1);
  border-radius: 13px;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--cat-color) 24%, #dfe4f0), inset 0 1px 0 #fff;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s var(--ease);
}
.tc-cta-arrow { transition: transform .2s var(--ease); font-size: 16px; }
body .test-card:hover .tc-cta {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat-color) 84%, #fff), var(--cat-color));
  border-color: transparent;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--cat-color) 62%, #000), inset 0 1px 0 rgba(255,255,255,.35);
}
/* метки «Выбор редакции» / «Пройден» — справа, на уровне категории; высоту карточки не увеличивают */
body .test-card .tc-card-flags {
  position: absolute !important; top: 16px; right: 12px; left: auto; width: auto !important;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  margin: 0 !important; z-index: 2; pointer-events: none;
}
body .test-card .tc-editor-pick-mark, body .test-card .tc-done-mark {
  position: static !important; margin: 0 !important;
  font: 700 11px/1 var(--sans); padding: 5px 9px; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0,0,0,.10), 0 4px 10px rgba(22,28,60,.12);
}
/* название категории уступает место меткам и при нехватке ширины переносится на вторую строку */
body .test-card:has(.tc-card-flags) .tc-cat-label { max-width: calc(100% - 124px); }
body .test-card:has(.tc-done-mark):not(:has(.tc-editor-pick-mark)) .tc-cat-label { max-width: calc(100% - 92px); }
body .test-card.is-completed { background: linear-gradient(180deg, #f1fbf6 0%, #fff 120px), #fff; }
@media (hover: none) {
  body .test-card:hover { box-shadow: 0 0 0 1px rgba(22,28,60,.06), 0 5px 0 color-mix(in srgb, var(--cat-color) 16%, #dfe4f0), 0 14px 28px -10px rgba(22,28,60,.18); }
  body .test-card:hover .tc-cta { color: color-mix(in srgb, var(--cat-color) 80%, #15172b); background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--cat-color) 8%, #fff)); border-color: color-mix(in srgb, var(--cat-color) 28%, #e1e5f1); box-shadow: 0 3px 0 color-mix(in srgb, var(--cat-color) 24%, #dfe4f0), inset 0 1px 0 #fff; }
}
@media (max-width: 680px) {
  body .test-card { padding: 16px 15px 14px !important; border-radius: 20px !important; }
  body .tc-desc .tc-clamp { -webkit-line-clamp: 2; line-clamp: 2; }
}

/* ─── 8. Пагинация ──────────────────────────────────────────── */
body .tests-pagination {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  margin: clamp(24px, 2.4vw, 40px) 0 0; padding: 0;
}
body .pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 46px; padding: 0 12px;
  font: 600 15px/1 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink-soft) !important; text-decoration: none !important;
  background: var(--surface-grad); border: 1px solid #fff; border-radius: 13px;
  box-shadow: 0 var(--key-depth) 0 #cfd5e6, 0 8px 16px -6px rgba(22,28,60,.16);
  transition: transform .1s, box-shadow .1s, color .15s;
}
body a.pagination-btn:hover { color: var(--accent) !important; box-shadow: 0 6px 0 #cfd5e6, 0 14px 20px -8px rgba(22,28,60,.2); }
body .pagination-btn.active {
  color: #fff !important; border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: 0 var(--key-depth) 0 color-mix(in srgb, var(--accent) 62%, #000), 0 10px 18px -6px color-mix(in srgb, var(--accent) 50%, transparent);
}
body .pagination-btn.disabled { opacity: .45; box-shadow: 0 2px 0 #d8ddea; }
body .pagination-dots { color: var(--ink-light); padding: 0 2px; }
@media (max-width: 420px) { body .pagination-btn { min-width: 40px; height: 42px; padding: 0 8px; font-size: 14px; } body .tests-pagination { gap: 6px; } }

/* ─── 9. Каталог «Все категории» ────────────────────────────── */
.catalog { padding: 0; }
.catalog-tools {
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: 120;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; margin: 0 0 clamp(16px, 1.6vw, 24px);
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid #fff; border-radius: 20px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(22,28,60,.05);
}
.catalog-filter {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 8px 0 14px;
  background: #f3f5fb; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: inset 0 2px 4px rgba(22,28,60,.07);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.catalog-filter:focus-within { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.catalog-filter-icon { opacity: .6; }
.catalog-filter input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 16px/1 var(--sans); color: var(--ink); }
.catalog-filter input::-webkit-search-cancel-button { display: none; }
.catalog-filter-clear { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #e3e8f3; color: var(--ink-soft); cursor: pointer; font-size: 14px; }
.catalog-jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.catalog-jump::-webkit-scrollbar { display: none; }
.catalog-jump-link {
  --sec-color: #5c4ee8;
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 12px;
  font: 600 13px/1 var(--sans); color: var(--ink-soft) !important; text-decoration: none !important; white-space: nowrap;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 2px 0 #d8ddea;
  transition: transform .1s, box-shadow .1s, border-color .15s, color .15s;
}
.catalog-jump-link:hover { border-color: var(--sec-color); color: var(--sec-color) !important; }
.catalog-empty { padding: 18px; background: #fff; border-radius: 16px; border: 1px solid var(--border); color: var(--ink-soft); }

.catalog-section {
  --sec-color: #5c4ee8;
  position: relative; margin: 0 0 clamp(16px, 1.6vw, 26px);
  padding: clamp(14px, 1.4vw, 22px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sec-color) 6%, #fff) 0, #fff 150px), #fff;
  border: 1px solid #fff; border-radius: 26px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(22,28,60,.05);
  scroll-margin-top: calc(var(--nav-h) + 150px);
}
.catalog-section-head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; flex-wrap: wrap; }
.catalog-section-icon {
  width: 56px; height: 56px; font-size: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--sec-color) 78%, #fff), var(--sec-color));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 color-mix(in srgb, var(--sec-color) 58%, #000), 0 14px 22px -8px color-mix(in srgb, var(--sec-color) 60%, transparent);
}
.catalog-section-titles { flex: 1 1 200px; min-width: 0; }
.catalog-section-title { font-size: clamp(20px, 1.6vw, 26px); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; color: var(--ink); }
.catalog-section-meta { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.catalog-section-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
  font: 600 13.5px/1 var(--sans); color: #fff !important; text-decoration: none !important; white-space: nowrap;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sec-color) 84%, #fff), var(--sec-color));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--sec-color) 58%, #000), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.catalog-section-link:hover { filter: brightness(1.06); }
#catalog-school .catalog-section-link { color: #2a1c00 !important; }
.catalog-group { margin-top: 14px; }
.catalog-group:first-of-type { margin-top: 0; }
.catalog-group-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font: 700 12.5px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted);
}
.catalog-group-title a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.catalog-group-title a:hover { color: var(--sec-color); }
.catalog-group-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-str), transparent); }
summary.catalog-group-title { cursor: pointer; list-style: none; padding: 10px 12px; margin: 0; background: #f3f5fb; border-radius: 12px; border: 1px solid var(--border); }
summary.catalog-group-title::-webkit-details-marker { display: none; }
summary.catalog-group-title::after { display: none; }
.catalog-group-count { padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); letter-spacing: 0; }
.catalog-group-toggle { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--sec-color); font-weight: 600; }
.catalog-group-toggle::after { content: ' ▾'; }
details[open] > summary .catalog-group-toggle { font-size: 0; }
details[open] > summary .catalog-group-toggle::after { content: 'Скрыть ▴'; font-size: 12.5px; }
details.catalog-group[open] > summary { margin-bottom: 12px; }

body .catalog-grid.cats-grid {
  display: grid !important; gap: 8px !important; max-width: none !important; margin: 0 !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)) !important;
}
body .cat-card.cat-card-row {
  --cat-color: var(--sec-color);
  display: flex !important; flex-direction: row; align-items: center; gap: 10px; text-align: left;
  min-height: 52px; padding: 7px 10px 7px 7px !important;
  color: var(--ink) !important; text-decoration: none !important;
  background: linear-gradient(180deg, #fff, #f9faff) !important;
  border: 1px solid var(--border) !important; border-top: 1px solid var(--border) !important; border-radius: 14px !important;
  box-shadow: 0 3px 0 #dde2ee !important;
  transform: none;
  transition: transform .12s var(--ease), box-shadow .12s, border-color .15s, background .15s !important;
}
body .cat-card.cat-card-row::before, body .cat-card.cat-card-row::after { display: none !important; }
body .cat-card.cat-card-row:hover {
  border-color: color-mix(in srgb, var(--cat-color) 55%, #fff) !important;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--cat-color) 9%, #fff)) !important;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--cat-color) 30%, #dde2ee), 0 14px 20px -10px color-mix(in srgb, var(--cat-color) 45%, transparent) !important;
}
body .cat-card-row .cat-icon {
  width: 36px; height: 36px; font-size: 19px; margin: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 11px;
  background: linear-gradient(160deg, #fff, color-mix(in srgb, var(--cat-color) 18%, #fff));
  box-shadow: 0 2px 0 color-mix(in srgb, var(--cat-color) 26%, #d8deec), inset 0 1px 0 #fff;
}
body .cat-card-row .cat-name { flex: 1; min-width: 0; margin: 0; text-align: left; font: 600 14px/1.25 var(--sans); color: var(--ink); overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
body .cat-card-row .cat-count {
  flex-shrink: 0; margin: 0; padding: 4px 8px; min-width: 30px; text-align: center;
  font: 700 11.5px/1 var(--sans); font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--cat-color) 75%, #15172b);
  background: color-mix(in srgb, var(--cat-color) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--cat-color) 22%, #fff); border-radius: 999px;
}
body .cat-card-row.is-empty { opacity: .55; }
.catalog [hidden] { display: none !important; }
@media (max-width: 680px) {
  .catalog-tools { top: calc(var(--nav-h) + 6px); padding: 10px; border-radius: 16px; }
  .catalog-section { border-radius: 20px; padding: 12px; }
  .catalog-section-icon { width: 46px; height: 46px; font-size: 23px; border-radius: 14px; }
  .catalog-section-link { width: 100%; justify-content: center; }
  body .catalog-grid.cats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  body .cat-card-row .cat-name { font-size: 13px; }
  body .cat-card-row .cat-icon { width: 32px; height: 32px; font-size: 17px; }
}
@media (max-width: 360px) { body .catalog-grid.cats-grid { grid-template-columns: 1fr !important; } }

/* Старые плитки категорий (другие страницы) — тот же объём */
body .cat-card:not(.cat-card-row) {
  border-radius: 20px; border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(22,28,60,.06), 0 5px 0 color-mix(in srgb, var(--cat-color, var(--accent)) 16%, #dfe4f0), 0 14px 28px -10px rgba(22,28,60,.18);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

/* Школьные блоки-ссылки: сохраняем прежний мягкий вид, добавляем только объём и ширину */
body .school-hub { padding: 0 0 clamp(16px, 1.6vw, 24px) !important; max-width: none; margin: 0; gap: clamp(12px, 1.2vw, 18px); }
body .school-hub-block { border-radius: 22px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.8); }
body .school-link-card { box-shadow: 0 2px 0 color-mix(in srgb, var(--cat-color, #60a5fa) 22%, #dde2ee); transition: transform .12s var(--ease), box-shadow .12s, border-color .15s; }
body .school-link-card:hover { box-shadow: 0 4px 0 color-mix(in srgb, var(--cat-color, #60a5fa) 30%, #dde2ee), 0 10px 16px -8px rgba(41,78,138,.25); }

/* ─── 10. Кнопки и общие поверхности ────────────────────────── */
body .btn, body a.btn, body button.btn {
  border-radius: 13px;
  transition: transform .1s, box-shadow .1s, filter .15s, background .15s;
}
body .btn-primary, body a.btn-primary, body button.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  border-color: transparent; color: #fff;
  box-shadow: 0 var(--key-depth) 0 color-mix(in srgb, var(--accent) 62%, #000), 0 12px 20px -8px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
}
body .btn-primary:hover { filter: brightness(1.06); }
body .alert { border-radius: 16px; box-shadow: var(--shadow-sm); }
body .faq-item, body .about-card, body .info-card { border-radius: var(--radius-lg); box-shadow: var(--shadow); border-color: #fff; }

/* ─── 11. Прохождение теста: ответы-клавиши ─────────────────── */
body .test-header { box-shadow: 0 10px 30px -18px rgba(22,28,60,.3); border-bottom: 1px solid #fff; background: var(--surface-grad); padding-left: var(--page-pad); padding-right: var(--page-pad); }
body .test-header-inner, body .questions-wrap, body .submit-wrap { max-width: 860px; }
body .question-block {
  border: 1px solid #fff; border-radius: 24px;
  background: var(--surface-grad);
  box-shadow: var(--shadow), 0 0 0 1px rgba(22,28,60,.05);
  padding: clamp(18px, 2vw, 30px);
}
body .q-text { font-size: clamp(16px, 1.2vw, 18.5px); line-height: 1.45; font-weight: 600; }
body .q-options { gap: 12px; }

/* Клавиша: вся плашка — одна большая кнопка */
body .opt-label {
  --key-face: linear-gradient(180deg, #ffffff 0%, #f6f8fd 100%);
  --key-edge: #cfd5e6;
  position: relative;
  align-items: center; gap: 12px;
  min-height: 54px; padding: 13px 16px;
  font-size: 15px; line-height: 1.4; color: var(--ink-soft);
  background: var(--key-face);
  border: 1px solid #dfe4f0; border-radius: 15px;
  box-shadow: 0 var(--key-depth) 0 var(--key-edge), 0 10px 16px -8px rgba(22,28,60,.18), inset 0 1px 0 #fff;
  transform: translateY(0);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .09s ease-out, box-shadow .09s ease-out, background .15s, border-color .15s, color .15s;
}
body .opt-label:hover {
  color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, #dfe4f0);
  background: linear-gradient(180deg, #fff 0%, var(--accent-soft) 100%);
  --key-edge: color-mix(in srgb, var(--accent) 30%, #cfd5e6);
  box-shadow: 0 calc(var(--key-depth) + 1px) 0 var(--key-edge), 0 14px 20px -8px rgba(22,28,60,.2), inset 0 1px 0 #fff;
}
/* нажатие — только затемнение грани, без сдвига */
/* выбранный ответ — подсветка цветом раздела, положение не меняется */
body .opt-label:has(input:checked) {
  color: var(--ink); font-weight: 600;
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, color-mix(in srgb, var(--accent) 16%, #fff) 100%);
  box-shadow: 0 var(--key-depth) 0 color-mix(in srgb, var(--accent) 45%, #cfd5e6), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), inset 0 1px 0 #fff;
}
body .opt-label:focus-within { outline: none; }
body .opt-label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 70%, #fff); outline-offset: 3px; }
body .opt-label input[type="radio"],
body .opt-label input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin: 0; flex-shrink: 0;
  border: 2px solid #c3cadd; background: #fff;
  box-shadow: inset 0 2px 3px rgba(22,28,60,.10);
  display: inline-grid; place-content: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
body .opt-label input[type="radio"] { border-radius: 50%; }
body .opt-label input[type="checkbox"] { border-radius: 8px; }
body .opt-label input[type="radio"]::before,
body .opt-label input[type="checkbox"]::before { content: ''; transform: scale(0); transition: transform .14s var(--ease); }
body .opt-label input[type="radio"]::before { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
body .opt-label input[type="checkbox"]::before { width: 12px; height: 12px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 22%, 86% 10%, 39% 70%); }
body .opt-label input:checked { border-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 2px 5px color-mix(in srgb, var(--accent) 45%, transparent); }
body .opt-label input:checked::before { transform: scale(1); }
body .opt-label:hover input:not(:checked) { border-color: var(--accent); }
body .opt-label input:focus, body .opt-label input:focus-visible { outline: none; }

/* Шкалы и Лайкерт — такие же клавиши */
body .scale-btn, body .likert-opt {
  border: 1px solid #dfe4f0; border-radius: 13px;
  background: linear-gradient(180deg, #fff 0%, #f6f8fd 100%);
  box-shadow: 0 var(--key-depth) 0 #cfd5e6, 0 8px 14px -8px rgba(22,28,60,.18), inset 0 1px 0 #fff;
  transform: translateY(0); user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .09s ease-out, box-shadow .09s ease-out, background .15s, border-color .15s, color .15s;
}
body .scale-btn:hover, body .likert-opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, #dfe4f0); }
body .scale-btn.sel, body .scale-btn.selected, body .likert-opt.sel {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: 0 var(--key-depth) 0 color-mix(in srgb, var(--accent) 62%, #000), 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent), inset 0 1px 0 rgba(255,255,255,.3);
}
body .submit-btn {
  border-radius: 16px; min-height: 58px; font-size: 17px; font-weight: 700;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 62%, #000), 0 18px 28px -10px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
body .submit-btn:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent)); filter: brightness(1.06); }
body .submit-btn:disabled { transform: none; filter: none; box-shadow: 0 2px 0 #c3c9da; }
body .progress-bar-wrap { height: 8px; border-radius: 999px; box-shadow: inset 0 1px 3px rgba(22,28,60,.14); }
body .progress-bar-fill { border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent); }
@media (max-width: 680px) {
  body .question-block { border-radius: 20px; }
  body .opt-label { min-height: 56px; padding: 13px 14px; font-size: 15px; }
}

/* ─── 12. Подвал ────────────────────────────────────────────── */
body .site-footer {
  position: relative; margin-top: 0;
  padding: clamp(26px, 3vw, 44px) var(--page-pad);
  background: var(--hero-grad, linear-gradient(135deg, #1d2540, #3a6ea5));
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 14px 30px -18px rgba(0,0,0,.5);
}
body .footer-inner { max-width: var(--page-max); align-items: center; text-align: center; gap: 16px; }
body .footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
body .footer-nav a {
  padding: 8px 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,.88); text-decoration: none;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  transition: background .15s, transform .15s var(--ease);
}
body .footer-nav a:hover { background: rgba(255,255,255,.18); color: #fff; }
body .footer-copy { color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.7; }
.footer-author { color: rgba(255,255,255,.55); font-size: 12px; }

/* ─── 13. Мобильная панель вкладок и кнопка «наверх» ────────── */
.mobile-tabbar { display: none; }
.to-top-btn {
  position: fixed; right: clamp(14px, 2vw, 32px); bottom: clamp(18px, 2vw, 32px); z-index: 900;
  width: 50px; height: 50px; border: 1px solid #fff; border-radius: 16px; cursor: pointer;
  font: 700 20px/1 var(--sans); color: var(--ink);
  background: var(--surface-grad);
  box-shadow: 0 var(--key-depth) 0 #cfd5e6, var(--shadow-lg);
  transition: transform .1s, box-shadow .1s, opacity .2s;
}
.to-top-btn[hidden] { display: none; }

@media (max-width: 1024px) {
  .mobile-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1800;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
    border-top: 1px solid rgba(22,28,60,.08);
    box-shadow: 0 -10px 30px rgba(22,28,60,.12);
  }
  .mobile-tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 5px 2px; border-radius: 14px;
    color: var(--ink-muted) !important; text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s, background .15s, color .15s;
  }
  .mobile-tabbar-item:active { background: var(--paper); }
  .mobile-tabbar-icon { font-size: 21px; line-height: 1; filter: grayscale(.35); transition: transform .2s var(--ease), filter .2s; }
  .mobile-tabbar-label { font: 600 11px/1.1 var(--sans); white-space: nowrap; }
  .mobile-tabbar-item.active { color: var(--ink) !important; background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
  .mobile-tabbar-item.active .mobile-tabbar-icon { filter: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .to-top-btn { bottom: calc(78px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  /* на странице теста внизу своя панель прогресса — вкладки не мешают прохождению */
  body.page-test .mobile-tabbar { display: none; }
  body.page-test { padding-bottom: 0; }
  body.page-test .to-top-btn { display: none; }
}
@media (max-width: 360px) { .mobile-tabbar-label { font-size: 10px; } }

/* ─── 14. Появление и доступность ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  body .tests-grid .test-card { animation-delay: calc(min(var(--i, 0), 12) * 28ms); }
  .catalog-section, .section-tile { }
  }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .mobile-tabbar, .to-top-btn, .skip-link, .catalog-tools { display: none !important; }
  body { background: #fff; padding-bottom: 0; }
}

/* ─── 15. Спокойная типографика ─────────────────────────────────
   В Windows шрифт Segoe UI отображает начертания 800–900 как самый
   тяжёлый Black. Заголовки ограничены полужирным 700, подписи и
   кнопки — 600, чтобы текст не «давил». */
body .hero h1, body .hero-cat-title, body .hero-compact-title, body .result-title, body .test-title,
body .profile-hero-info h1, body .err-code, body .interp-title, body .knowledge-review-title,
body .profile-interps-title, body .stat-num, body .metric-card-num, body .hcs-num { font-weight: 700; }
body .tc-title, body .q-text, body .catalog-group-title, body .tc-cat-label,
body .school-hub-name, body .school-link-card, body .school-link-count, body .sidebar-mini-label,
body .home-school-all, body .home-school-grade, body .home-school-dd summary,
body .knowledge-mistake-question, body .knowledge-mistake-num, body .profile-scale-name,
body .profile-scale-result, body .profile-scale-badge, body .card-share-btn, body .btn-finish,
body .situation-kicker, body .top-section-dd-panel a,
body .test-card .tc-editor-pick-mark, body .test-card .tc-done-mark,
body .tc-done-mark.tc-score-mark.is-perfect { font-weight: 600; }
body .top-section-pill.top-section-pill { font-weight: 600 !important; }
body .site-header-brand { font-weight: 700; letter-spacing: -.01em; }
body .sidebar-item { font-weight: 400; }
body .sidebar-item.active, body .sidebar-group.active > .sidebar-parent { font-weight: 600; }
body .tc-cat-label, body .catalog-group-title, body .sidebar-label { letter-spacing: .04em; }
body .tc-title { font-size: 16px; letter-spacing: 0; line-height: 1.32; }
body .tc-desc { color: var(--ink-muted); }

/* ─── 16. Без движения ──────────────────────────────────────────
   Элементы не сдвигаются при наведении, нажатии и выборе: отклик
   даётся только цветом, рамкой и тенью. Правила ниже гасят сдвиги,
   оставшиеся в прежнем style.css и во встроенных стилях страниц. */
body .opt-label:active, body .opt-label.is-pressing, body .scale-btn:active, body .likert-opt:active { filter: brightness(.97); }
body .test-card, body .test-card:hover, body .test-card:active,
body .cat-card, body .cat-card:hover, body .cat-card:active,
body .section-tile:hover, body .section-tile:active,
body .top-section-pill.top-section-pill:hover, body .top-section-pill.top-section-pill:active,
body .opt-label, body .opt-label:hover, body .opt-label:active,
body .scale-btn, body .scale-btn:hover, body .scale-btn:active, body .scale-btn.sel,
body .likert-opt, body .likert-opt:hover, body .likert-opt:active, body .likert-opt.sel,
body .submit-btn:hover, body .submit-btn:active, body .submit-btn-main:hover, body .submit-btn-main:active,
body .btn:hover, body .btn:active, body .btn-next:hover, body .btn-next:active,
body .pagination-btn:hover, body .pagination-btn:active, body .sort-tab:active,
body .site-header-brand:hover, body .site-header-brand:active, body .btn-vk-login:hover, body .btn-vk-login:active,
body .site-header-search button:active, body .sidebar-item:hover, body .school-link-card:hover, body .school-link-card:active,
body .hero-stat:hover, body .footer-nav a:hover, body .to-top-btn:hover, body .to-top-btn:active,
body .mobile-sidebar-btn:active, body .sidebar-toggle-btn:active, body .mobile-tabbar-item:active,
body .catalog-jump-link:hover, body .catalog-jump-link:active, body .catalog-section-link:hover, body .catalog-section-link:active,
body .hero-info-card:hover, body a.hero-btn-primary:hover, body a.hero-btn-outline:hover { transform: none !important; }
body .tests-grid .test-card, body .section-tile, body .catalog-section, body .fade-in { animation: none !important; }
body .mobile-tabbar-item.active .mobile-tabbar-icon { transform: none; }
body .test-card:hover .tc-cta-arrow, body .sidebar-group:hover > .sidebar-parent .si-arrow { transform: none; }
