/* ════════════════════════════════════════════════════════════════════
   SESSION TESTS — UI/UX redesign
   Оболочка (shell), hero, каталог, тренировка, единые модалки,
   фокус-экран теста, пустые состояния, responsive + performance-mode.
   Подключается ПОСЛЕ main.css и ig-theme.css.
   ════════════════════════════════════════════════════════════════════ */

/* ── 1. Базовый shell-слой ─────────────────────────────────────────── */
body.st-shell {
  display: block;
  align-items: unset;
  justify-content: unset;
  padding: 0;
  background: var(--ig-body-bg);
  color: var(--ig-text);
  font-family: var(--st-font-ui);
  min-height: 100vh;
}

.st-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.st-main {
  flex: 1;
  width: 100%;
  max-width: var(--st-content-max);
  margin: 0 auto;
  padding: var(--st-gap);
  padding-bottom: calc(var(--st-tabbar-h) + var(--st-gap) * 2);
}

body.st-shell > .st-tabbar {
  display: none;
}

/* ── 2. Шапка ─────────────────────────────────────────────────────── */
.st-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--st-header-h);
  background: color-mix(in srgb, var(--ig-surface) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ig-border);
}

.st-header-inner {
  max-width: var(--st-content-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--st-gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.st-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  flex-shrink: 0;
}

.st-logo-text {
  font-family: var(--st-font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ig-text);
  line-height: 1;
}

.st-logo-cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--ig-accent);
  animation: stCursorBlink 1.1s steps(2, start) infinite;
  border-radius: 1px;
}

@keyframes stCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.st-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.st-nav a {
  position: relative;
  color: var(--ig-text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  border-radius: var(--ig-radius-pill);
  transition: color .15s, background .15s;
}

.st-nav a:hover {
  color: var(--ig-text);
  background: var(--ig-surface-raised);
}

.st-nav a.is-active {
  color: var(--ig-accent);
}

.st-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--ig-accent-gradient);
}

/* ── 3. Авторизация в шапке ───────────────────────────────────────── */
[hidden] {
  display: none !important;
}

.st-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  cursor: pointer;
  transition: all .18s;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.st-btn:active {
  transform: scale(.97);
}

.st-btn-ghost {
  background: transparent;
  border-color: var(--ig-border-light);
  color: var(--ig-text);
}

.st-btn-ghost:hover {
  border-color: var(--ig-text-secondary);
  background: var(--ig-surface-raised);
}

.st-btn-accent {
  background: var(--ig-accent-gradient);
  color: #fff;
  box-shadow: 0 4px 22px color-mix(in srgb, var(--ig-accent) 35%, transparent);
}

.st-btn-accent:hover {
  filter: brightness(var(--ig-hover-brightness));
  box-shadow: 0 6px 30px color-mix(in srgb, var(--ig-accent) 55%, transparent);
}

.st-btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.st-btn-block {
  width: 100%;
}

.st-avatar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--ig-border);
  background: var(--ig-surface-raised);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.st-avatar-btn:hover {
  border-color: var(--ig-accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--ig-accent) 30%, transparent);
}

.st-avatar-btn .header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.header-auth-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ig-text-dim);
  border: 2px solid var(--ig-surface-raised);
  transition: background .2s;
}

.header-auth-indicator.is-authenticated {
  background: var(--ig-success);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ig-success) 60%, transparent);
}

.st-dropdown-wrap {
  position: relative;
}

.st-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 6px;
  background: var(--ig-surface-raised);
  border: 1px solid var(--ig-border);
  border-radius: var(--ig-radius-md);
  box-shadow: var(--ig-shadow-lg);
  animation: stDropIn .16s ease-out;
}

@keyframes stDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.st-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--ig-radius-sm);
  background: transparent;
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.st-dropdown-item:hover {
  background: var(--ig-surface-hover);
}

.st-dropdown-item.is-danger {
  color: var(--ig-error);
}

.st-dropdown-head {
  padding: 10px 12px 6px;
  font-size: 11px;
  color: var(--ig-text-muted);
  border-bottom: 1px solid var(--ig-divider);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 4. Мобильный tab-bar ─────────────────────────────────────────── */
.st-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 950;
  height: var(--st-tabbar-h);
  background: color-mix(in srgb, var(--ig-surface) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ig-border);
  display: flex;
}

.st-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ig-text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}

.st-tabbar a .st-tab-icon {
  font-size: 20px;
  line-height: 20px;
}

.st-tabbar a.is-active {
  color: var(--ig-accent);
}

/* ── 5. Модальная система (st-modal) ──────────────────────────────── */
.st-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.st-modal.is-open {
  display: flex;
}

.st-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--ig-surface);
  border: 1px solid var(--ig-border);
  border-radius: var(--st-radius-card);
  box-shadow: var(--ig-shadow-lg);
  padding: 24px;
  animation: stModalIn .22s cubic-bezier(.16,1,.3,1);
}

.st-modal-card.st-modal-wide {
  max-width: 640px;
}

.st-modal-card.st-modal-card-sm {
  max-width: 380px;
}

.st-confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.st-confirm-actions button {
  flex: 1;
}

.st-confirm-actions .st-btn-ghost {
  color: var(--ig-text-secondary);
}

@keyframes stModalIn {
  from { opacity: 0; transform: scale(.94) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.st-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
}

.st-modal-close:hover {
  background: var(--ig-accent);
  border-color: var(--ig-accent);
  color: #fff;
}

.st-modal-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 0 0 16px;
  padding-right: 36px;
}

/* ── 6. Auth-модалка (переиспользует .qz-auth-*) ─────────────────── */
#authModal .st-modal-card {
  max-width: 460px;
}

.st-auth-reason {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--ig-radius-sm);
  background: var(--ig-accent-bg);
  border: 1px solid color-mix(in srgb, var(--ig-accent) 30%, transparent);
  color: var(--ig-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.st-auth-badge {
  display: none;
}

#authModal .qz-auth-card {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

#authModal .qz-auth-brand {
  margin-bottom: 16px;
}

#authModal .qz-auth-logout {
  margin-bottom: 0;
  margin-top: 8px;
}

/* Индикатор силы пароля */
.qz-auth-strength-seg.is-weak   { background: var(--ig-error); }
.qz-auth-strength-seg.is-ok     { background: var(--ig-warning); }
.qz-auth-strength-seg.is-good   { background: var(--ig-success); }

/* ── 7. Hero главной ──────────────────────────────────────────────── */
.st-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
  padding: 36px;
  border-radius: var(--st-radius-card);
  border: 1px solid var(--ig-border);
  background:
    radial-gradient(600px 300px at 80% -10%, color-mix(in srgb, var(--ig-accent) 16%, transparent), transparent 60%),
    var(--ig-surface);
  box-shadow: var(--ig-shadow-sm);
  margin-bottom: var(--st-gap);
  overflow: hidden;
}

.st-hero-kicker {
  font-family: var(--st-font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ig-accent);
  margin-bottom: 12px;
}

.st-hero-title {
  font-family: var(--st-font-display);
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: 1px;
  line-height: 1;
  color: var(--ig-text);
  margin: 0 0 14px;
  text-shadow: 0 6px 40px color-mix(in srgb, var(--ig-accent) 30%, transparent);
}

.st-hero-title .st-glow {
  background: var(--ig-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.st-hero-sub {
  color: var(--ig-text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 0 22px;
}

.st-hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.st-hero-features {
  display: grid;
  gap: 10px;
}

.st-hero-feature {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
}

.st-hero-feature .st-hero-feature-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--ig-accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.st-hero-feature strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.st-hero-feature span {
  display: block;
  font-size: 12px;
  color: var(--ig-text-muted);
}

/* Компактное приветствие для авторизованных */
.st-hero-compact {
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.st-hero-compact .st-hero-kicker { margin-bottom: 6px; }
.st-hero-compact h2 { font-size: 22px; margin: 0 0 4px; }
.st-hero-compact p { color: var(--ig-text-secondary); font-size: 13px; margin: 0; }

/* ── 8. Секции страницы ───────────────────────────────────────────── */
.st-section {
  scroll-margin-top: calc(var(--st-header-h, 64px) + 16px);
  margin-bottom: calc(var(--st-gap) + 6px);
}

.st-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.st-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ig-text);
}

.st-section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--ig-accent-gradient);
  transform: rotate(45deg);
}

.st-section-sub {
  font-size: 12px;
  color: var(--ig-text-muted);
}

/* ── 9. Баннер продолжения сессии ────────────────────────────────── */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--ig-radius-md);
  border: 1px solid color-mix(in srgb, var(--ig-accent) 45%, transparent);
  background: var(--ig-accent-bg);
  margin-bottom: 14px;
}

.resume-banner[hidden] { display: none; }

.resume-banner-copy {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resume-banner-copy::before {
  content: "▶";
  color: var(--ig-accent);
}

.resume-banner-actions { display: flex; gap: 8px; }

.resume-banner-actions button {
  padding: 8px 16px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid var(--ig-accent);
  background: var(--ig-accent);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.resume-banner-actions button.resume-secondary {
  background: transparent;
  color: var(--ig-text-secondary);
}

/* ── 10. Каталог тестов ───────────────────────────────────────────── */
.st-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.st-search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.st-search input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid var(--ig-border-input);
  background: var(--ig-surface-input);
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.st-search input:focus {
  border-color: var(--ig-border-focus);
  box-shadow: var(--ig-focus-ring);
}

.st-search .st-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ig-text-dim);
  font-size: 14px;
  pointer-events: none;
}

.st-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.st-chip {
  padding: 8px 16px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.st-chip:hover {
  color: var(--ig-text);
  border-color: var(--ig-text-secondary);
}

.st-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--ig-accent-gradient);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--ig-accent) 35%, transparent);
}

/* Плитки тестов */
.test-list.st-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  max-height: none;
  overflow: visible;
  margin-bottom: 14px;
}

.test-list.st-catalog-grid .test-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  cursor: pointer;
  transition: all .18s;
  margin: 0;
}

.test-list.st-catalog-grid .test-item:hover {
  border-color: var(--ig-text-secondary);
  transform: translateY(-2px);
  box-shadow: var(--ig-shadow-sm);
}

.test-list.st-catalog-grid .test-item.selected {
  border-color: var(--ig-accent);
  background: color-mix(in srgb, var(--ig-accent) 9%, var(--ig-surface-raised));
}

.test-list.st-catalog-grid .test-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ig-text);
}

.test-list.st-catalog-grid .test-item-desc {
  font-size: 12px;
  color: var(--ig-text-muted);
}

.test-list.st-catalog-grid .test-item-tag {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: var(--ig-radius-pill);
  background: var(--ig-badge-bg);
  border: 1px solid var(--ig-badge-border);
  color: var(--ig-text-muted);
}

.test-list-empty,
.st-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ig-text-muted);
  font-size: 13px;
}

/* Детали выбранного теста */
.st-test-detail {
  padding: 22px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background:
    radial-gradient(320px 160px at 100% 0%, color-mix(in srgb, var(--ig-accent) 12%, transparent), transparent 60%),
    var(--ig-surface-raised);
  margin-bottom: 14px;
}

.st-test-detail h2 {
  font-size: 20px;
  margin: 0 0 4px;
}

.st-test-detail-meta {
  color: var(--ig-text-muted);
  font-size: 13px;
  margin: 0 0 16px;
}

.st-test-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.st-count-label {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ig-text-muted);
  margin-bottom: 8px;
}

.count-selector {
  margin-bottom: 4px;
}

.count-opt {
  min-width: 38px;
  height: 34px;
}

.count-opt.selected {
  border-color: var(--ig-accent);
  color: #fff;
  background: var(--ig-accent);
}

/* ── 11. Хаб «Тренировка» ─────────────────────────────────────────── */
.st-train-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.st-train-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: all .18s;
  width: 100%;
}

.st-train-card:hover {
  border-color: var(--ig-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 34px color-mix(in srgb, var(--ig-accent) 14%, transparent);
}

.st-train-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ig-accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 4px;
}

.st-train-card-title {
  font-size: 15px;
  font-weight: 700;
}

.st-train-card-desc {
  font-size: 12px;
  color: var(--ig-text-muted);
  line-height: 1.45;
}

.st-train-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  font-family: var(--st-font-mono);
  font-size: 11px;
  border-radius: var(--ig-radius-pill);
  background: var(--ig-badge-bg);
  border: 1px solid var(--ig-badge-border);
  color: var(--ig-text-secondary);
}

.st-train-card.is-danger { border-color: color-mix(in srgb, var(--ig-error) 35%, var(--ig-border)); }
.st-train-card.is-danger:hover { border-color: var(--ig-error); box-shadow: 0 10px 30px color-mix(in srgb, var(--ig-error) 12%, transparent); }
.st-train-card.is-danger .st-train-card-icon { background: var(--ig-error-bg); }

/* ── 12. Настройки / Оформление ───────────────────────────────────── */
.st-settings {
  display: grid;
  gap: 10px;
}

.st-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
}

.st-setting-info strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.st-setting-info span {
  display: block;
  font-size: 12px;
  color: var(--ig-text-muted);
}

/* Переключатель */
.st-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.st-switch input { opacity: 0; width: 0; height: 0; }
.st-switch .st-switch-track {
  position: absolute;
  inset: 0;
  border-radius: var(--ig-radius-pill);
  background: var(--ig-surface-hover);
  border: 1px solid var(--ig-border);
  transition: background .18s;
  cursor: pointer;
}
.st-switch .st-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ig-text-secondary);
  transition: all .18s;
}
.st-switch input:checked + .st-switch-track {
  background: var(--ig-accent);
  border-color: var(--ig-accent);
}
.st-switch input:checked + .st-switch-track::after {
  transform: translateX(20px);
  background: #fff;
}

/* Палитра тем */
.st-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.st-theme-swatch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: all .15s;
}

.st-theme-swatch:hover {
  border-color: var(--ig-text-secondary);
}

.st-theme-swatch.is-active {
  border-color: var(--ig-accent);
  box-shadow: var(--ig-focus-ring);
}

.st-theme-dot {
  height: 42px;
  border-radius: var(--ig-radius-sm);
  background: linear-gradient(135deg, var(--sw-a, #7B6CF6), var(--sw-b, #F472B6));
}

.st-theme-swatch span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ig-text-secondary);
}

.st-theme-swatch.is-active span { color: var(--ig-accent); }

/* ── 13. Фокус-экран теста (#quiz) ────────────────────────────────── */
#quiz {
  position: fixed;
  inset: 0;
  z-index: 3000;
  max-width: none;
  width: 100%;
  border-radius: 0;
  border: none;
  background: var(--ig-body-bg);
  overflow-y: auto;
}

#quiz .card-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.st-quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ig-divider);
}

.st-quiz-testname {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-quiz-timer {
  font-family: var(--st-font-mono);
  font-size: 15px;
  letter-spacing: 2px;
  padding: 5px 12px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid color-mix(in srgb, var(--ig-accent) 40%, transparent);
  background: var(--ig-accent-bg);
  color: var(--ig-accent);
  display: none;
}

.st-quiz-exit {
  background: none;
  border: 1px solid var(--ig-border);
  color: var(--ig-text-secondary);
  padding: 7px 14px;
  border-radius: var(--ig-radius-pill);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.st-quiz-exit:hover { color: var(--ig-error); border-color: var(--ig-error); }

.st-quiz-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--ig-surface-raised);
  overflow: hidden;
  margin-bottom: 20px;
}

.st-quiz-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--ig-accent-gradient);
  transition: width .25s ease;
}

#quiz .question h2 {
  font-family: var(--st-font-display);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--ig-text-dim);
  margin-bottom: 10px;
}

.question p { font-size: 18px; line-height: 1.55; }

/* Закладка + отправка другу */
.bookmark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.bookmark-row .bookmark-btn {
  padding: 9px 16px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.bookmark-row .bookmark-btn.is-bookmarked {
  border-color: var(--ig-accent);
  color: var(--ig-accent);
  background: var(--ig-accent-bg);
}

.quiz-share-btn {
  padding: 9px 14px;
  border-radius: var(--ig-radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ig-text-muted);
  font-size: 12px;
  cursor: pointer;
}

.quiz-share-btn:hover { color: var(--ig-accent); }

/* Варианты ответа — крупные тап-зоны */
.answers button {
  min-height: 52px;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: var(--ig-radius-md);
  border: 1.5px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text);
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  text-align: left;
}

.answers button:hover:not(:disabled) {
  border-color: var(--ig-accent);
  background: color-mix(in srgb, var(--ig-accent) 8%, var(--ig-surface-raised));
}

.answers button.correct {
  border-color: var(--ig-success);
  background: var(--ig-success-bg);
}

.answers button.wrong {
  border-color: var(--ig-error);
  background: var(--ig-error-bg);
}

#quiz .controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

#quiz .controls button {
  flex: 1;
  min-width: 110px;
  padding: 13px 16px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
}

#quiz .controls button#next {
  background: var(--ig-accent-gradient);
  border-color: transparent;
  color: #fff;
}

#quiz .controls button:disabled { opacity: var(--ig-disabled-opacity); cursor: not-allowed; }

#quiz .stats {
  font-family: var(--st-font-mono);
  color: var(--ig-text-dim);
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 18px;
}

/* ── 14. Единые модалки (существующие #…Modal) ───────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  text-align: center;
  padding: 32px 28px;
  border-radius: var(--st-radius-card);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface);
  box-shadow: var(--ig-shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: stModalIn .22s cubic-bezier(.16,1,.3,1);
}

.modal-content h2 {
  font-family: var(--st-font-display);
  font-size: 26px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.modal-content p {
  color: var(--ig-text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 22px;
  white-space: pre-line;
}

.modal-content > button {
  display: block;
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 8px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.modal-content > button:first-of-type {
  background: var(--ig-accent-gradient);
  border-color: transparent;
  color: #fff;
}

/* Крестик в углах существующих модалок */
.modal-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.modal-close-x:hover { background: var(--ig-accent); border-color: var(--ig-accent); color: #fff; }

/* Разбор ответов */
.review-modal .modal-content { text-align: left; }
.review-summary { margin-bottom: 16px; }
.review-kpis { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.review-kpi {
  padding: 6px 12px;
  border-radius: var(--ig-radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--ig-badge-bg);
  border: 1px solid var(--ig-badge-border);
}
.review-kpi.is-correct { color: var(--ig-success); }
.review-kpi.is-wrong { color: var(--ig-error); }
.review-kpi.is-empty { color: var(--ig-text-muted); }
.review-hint { font-size: 12px; color: var(--ig-text-muted); margin-bottom: 14px; }
.review-item {
  padding: 14px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  margin-bottom: 10px;
}
.review-question { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.review-options { display: grid; gap: 6px; margin-bottom: 10px; }
.review-option {
  padding: 8px 12px;
  border-radius: var(--ig-radius-sm);
  border: 1px solid var(--ig-border);
  font-size: 13px;
}
.review-option.is-correct   { border-color: var(--ig-success); background: var(--ig-success-bg); }
.review-option.is-wrong     { border-color: var(--ig-error); background: var(--ig-error-bg); }
.review-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.review-tag { font-size: 11px; padding: 4px 10px; border-radius: var(--ig-radius-pill); background: var(--ig-badge-bg); border: 1px solid var(--ig-badge-border); }
.review-tag.is-correct { color: var(--ig-success); }
.review-tag.is-wrong { color: var(--ig-error); }
.review-tag.is-empty { color: var(--ig-text-muted); }

/* Достижения */
.achievements-list { display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.achievement-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  text-align: left;
}
.achievement-item.is-locked { opacity: .4; }
.achievement-item .ach-icon { font-size: 24px; flex-shrink: 0; }
.achievement-item .ach-title { font-size: 13px; font-weight: 700; }
.achievement-item .ach-text { font-size: 12px; color: var(--ig-text-muted); }

/* Профиль-модалка и редактор */
.profile-editor-grid { display: grid; gap: 12px; }
.profile-editor-field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--ig-text-muted);
  margin-bottom: 6px;
  text-align: left;
}
.profile-editor-field input,
.profile-editor-field select,
.profile-editor-field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--ig-radius-sm);
  border: 1px solid var(--ig-border-input);
  background: var(--ig-surface-input);
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.profile-editor-field input:focus,
.profile-editor-field select:focus,
.profile-editor-field textarea:focus {
  border-color: var(--ig-border-focus);
  box-shadow: var(--ig-focus-ring);
}
.profile-editor-actions { display: flex; gap: 8px; margin-top: 16px; }
.profile-editor-actions button {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--ig-radius-md);
  border: 1px solid var(--ig-border);
  background: var(--ig-surface-raised);
  color: var(--ig-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.profile-editor-actions button:first-child { background: var(--ig-accent-gradient); border-color: transparent; color: #fff; }

.st-profile-delete-msg {
  font-size: 12px;
  color: var(--ig-text-muted);
  margin-bottom: 12px;
  text-align: left;
}

/* ── 15. Пустые состояния (глобальные) ────────────────────────────── */
.st-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 44px 24px;
}

.st-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--ig-surface-raised);
  border: 1px solid var(--ig-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 4px;
}

.st-empty-title { font-size: 16px; font-weight: 700; color: var(--ig-text); }
.st-empty-text { font-size: 13px; color: var(--ig-text-muted); max-width: 300px; line-height: 1.5; }

/* ── 16. Футер ────────────────────────────────────────────────────── */
.st-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px var(--st-gap) 26px;
  border-top: 1px solid var(--ig-border);
  font-size: 12px;
  color: var(--ig-text-muted);
}

.st-footer a {
  color: var(--ig-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--ig-radius-pill);
  transition: color .15s;
}

.st-footer a:hover { color: var(--ig-accent); }

.st-footer .st-footer-initials {
  font-family: var(--st-font-display);
  letter-spacing: 2px;
  color: var(--ig-text-dim);
}

/* ── 17. Родные страницы (index2–5) внутри shell ─────────────────── */
body.st-shell .ig-container {
  margin: 0 auto;
  max-width: 1100px;
  border: 1px solid var(--ig-border);
  border-radius: var(--st-radius-card);
  box-shadow: var(--ig-shadow-sm);
  background: var(--ig-surface);
  width: calc(100% - 2 * var(--st-gap));
}

body.st-shell .ig-header {
  top: var(--st-header-h);
}

body.st-shell .ig-container .ig-header { position: sticky; }

/* ── 18. Performance mode ─────────────────────────────────────────── */
body.performance-mode .st-hero-feature,
body.performance-mode .st-train-card,
body.performance-mode .test-list.st-catalog-grid .test-item {
  animation: none !important;
}

/* ── 19. Responsive ───────────────────────────────────────────────── */
@media (max-width: 520px) {
  body.st-shell .ig-container {
    width: 100%;
    border-radius: 0;
    border: none;
  }
}

@media (max-width: 899px) {
  .st-nav { display: none; }
  .st-tabbar { display: flex; }
  .st-avatar-btn { width: 36px; height: 36px; }

  .st-hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 20px;
  }

  .st-main { padding-bottom: calc(var(--st-tabbar-h) + var(--st-gap) * 2); }

  .st-theme-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (min-width: 900px) {
  body.st-shell > .st-tabbar { display: none; }
}

/* Мелкие таp-зоны на мобильных увеличиваем */
@media (max-width: 600px) {
  .test-list.st-catalog-grid { grid-template-columns: 1fr; }
  .st-train-grid { grid-template-columns: 1fr; }
  .st-hero-cta .st-btn { flex: 1; }
  .modal-content { padding: 26px 18px; }
}

/* ── 20. Пакетные темы (дизайн перенесён со старой версии) ───────── */
.theme-groups {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.theme-groups button {
    padding: 10px 18px;
    border-radius: 0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 11px;
    transition: all .2s;
    background: transparent;
}

.theme-subgroup {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
}

body[data-theme-group="cyberpunk"] .theme-subgroup[data-group="cyberpunk"],
body[data-theme-group="arthouse"]  .theme-subgroup[data-group="arthouse"],
body[data-theme-group="noir"]      .theme-subgroup[data-group="noir"],
body[data-theme-group="bts"]       .theme-subgroup[data-group="bts"],
body[data-theme-group="neutral"]   .theme-subgroup[data-group="neutral"],
body:not([data-theme-group])       .theme-subgroup[data-group="arthouse"] {
    display: flex;
}

/* ── Groups — CYBERPUNK ─────────────────────────────────────────── */
body[data-theme-group="cyberpunk"] .theme-groups button {
    border: 1px solid var(--t-border);
    color: var(--t-muted);
    font-family: 'JetBrains Mono', monospace;
}

body[data-theme-group="cyberpunk"] .theme-groups button:hover,
body[data-theme-group="cyberpunk"] .theme-groups button.is-active {
    background: var(--green-faint);
    color: var(--green);
    border-color: var(--green-dim);
    box-shadow: 0 0 12px var(--green-glow);
}

/* ── Groups — ARTHOUSE ──────────────────────────────────────────── */
body[data-theme-group="arthouse"] .theme-groups button,
body[data-theme-group="neutral"]  .theme-groups button {
    border: 1.5px solid var(--border);
    background-image: linear-gradient(to right, var(--btn-sweep) 0%, var(--btn-sweep) 100%);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left center;
    color: var(--ink);
    font-family: 'Syne Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    transition: background-size .25s ease, color .25s ease, border-color .2s ease;
}

body[data-theme="gay"] .theme-groups button {
    color: rgba(242,238,248,.45);
}

body[data-theme-group="arthouse"] .theme-groups button:hover,
body[data-theme-group="arthouse"] .theme-groups button.is-active,
body[data-theme-group="neutral"]  .theme-groups button:hover,
body[data-theme-group="neutral"]  .theme-groups button.is-active {
    background-size: 100% 100%;
    color: var(--btn-text-hover);
    border-color: var(--btn-sweep);
}

/* ── Groups — NOIR ──────────────────────────────────────────────── */
body[data-theme-group="noir"] .theme-groups button {
    border: 1px solid rgba(232,225,215,.25);
    background: transparent;
    color: rgba(232,225,215,.7);
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 2px;
}

body[data-theme-group="noir"] .theme-groups button:hover,
body[data-theme-group="noir"] .theme-groups button.is-active {
    background: rgba(232,225,215,.12);
    color: #ffffff;
    border-color: rgba(232,225,215,.6);
    box-shadow: 0 0 12px rgba(255,255,255,.08);
}

/* ── Switcher — TERMINAL ────────────────────────────────────────── */
body[data-theme="terminal"] .theme-switcher,
body[data-theme="neon-t"]   .theme-switcher,
body[data-theme="amber"]    .theme-switcher {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    animation: fadeIn .6s ease-out .7s both;
    flex-wrap: wrap;
}
body[data-theme="terminal"] .theme-switcher button,
body[data-theme="neon-t"]   .theme-switcher button,
body[data-theme="amber"]    .theme-switcher button {
    padding: 10px 16px;
    border: 1px solid var(--t-border);
    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    background: transparent;
    color: var(--t-muted);
    transition: all .2s;
    font-size: 12px;
    letter-spacing: 1px;
}
body[data-theme="terminal"] .theme-switcher button:hover,
body[data-theme="neon-t"]   .theme-switcher button:hover,
body[data-theme="amber"]    .theme-switcher button:hover {
    background: var(--green-faint);
    color: var(--green);
    border-color: var(--green-dim);
}
body[data-theme-group="cyberpunk"] .theme-switcher button.is-active {
    background: var(--green-faint);
    color: var(--green);
    border-color: var(--green-dim);
    box-shadow: 0 0 12px var(--green-glow);
}

/* ── Switcher — ARTHOUSE / NOIR ─────────────────────────────────── */
body[data-theme="arthouse"] .theme-switcher,
body[data-theme="noir"] .theme-switcher,
body[data-theme="newyear"]  .theme-switcher,
body[data-theme="gay"]      .theme-switcher,
body[data-theme="neutral"]  .theme-switcher {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    padding-top: 28px;
    margin-top: 36px;
    border-top: 1.5px solid var(--border);
    flex-wrap: wrap;
}
body[data-theme="arthouse"] .theme-switcher button,
body[data-theme="noir"] .theme-switcher button,
body[data-theme="newyear"]  .theme-switcher button,
body[data-theme="gay"]      .theme-switcher button,
body[data-theme="neutral"]  .theme-switcher button {
    padding: 9px 18px;
    border: 1.5px solid var(--border);
    background-color: transparent;
    background-image: linear-gradient(to right, var(--btn-sweep) 0%, var(--btn-sweep) 100%);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left center;
    color: color-mix(in srgb, var(--ig-text) 46%, transparent);
    font-family: 'Syne Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-size .25s ease, color .25s ease, border-color .2s ease;
    border-radius: 0;
}
body[data-theme="gay"] .theme-switcher button { color: rgba(242,238,248,.45); }

body[data-theme="arthouse"] .theme-switcher button:hover,
body[data-theme="noir"] .theme-switcher button:hover,
body[data-theme="newyear"]  .theme-switcher button:hover,
body[data-theme="gay"]      .theme-switcher button:hover {
    background-size: 100% 100%;
    color: var(--btn-text-hover);
    border-color: var(--btn-sweep);
}

body[data-theme-group="arthouse"] .theme-switcher button.is-active,
body[data-theme-group="noir"] .theme-switcher button.is-active {
    background-size: 100% 100%;
    color: var(--btn-text-hover);
    border-color: var(--btn-sweep);
}

/* ── Switcher/Groups — NOIR переопределения ─────────────────────── */
body[data-theme="noir"] .theme-switcher button,
body[data-theme="noir"] .theme-groups button {
    color: rgba(232,225,215,.65);
    border-color: rgba(232,225,215,.25);
}

/* BTS-карточки участников (дизайн со старой версии) */
.bts-member-cards {
  display: none;
}
body[data-theme="bts-jk"] .bts-member-cards,
body[data-theme="bts-jimin"] .bts-member-cards,
body[data-theme="bts-jhope"] .bts-member-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 28px;
}

.bts-member-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--ig-radius-sm);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  height: 140px;
}
body[data-theme="bts-jk"] .bts-member-card { border-radius: 0; }
body[data-theme="bts-jhope"] .bts-member-card { border-radius: 0; }

.bts-member-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--a1);
  box-shadow: 0 12px 36px var(--shadow);
}

.bts-member-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  filter: brightness(.45) saturate(.9);
  transition: filter .4s ease, transform .4s ease;
}
.bts-member-card:hover .bts-member-card-bg {
  filter: brightness(.55) saturate(1.1);
  transform: scale(1.07);
}

.bts-member-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.bts-member-card-name {
  display: block;
  font-size: 16px; font-weight: 700; color: var(--a1);
  letter-spacing: 1px; line-height: 1;
}
body[data-theme="bts-jk"] .bts-member-card-name {
  font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 3px;
}
body[data-theme="bts-jimin"] .bts-member-card-name {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-weight: 300; font-size: 20px; letter-spacing: 2px;
}
body[data-theme="bts-jhope"] .bts-member-card-name {
  font-family: 'Black Han Sans', sans-serif;
  background: linear-gradient(90deg, var(--a1), var(--a2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-size: 18px;
}

.bts-member-card.active-member {
  border-color: var(--a1);
  box-shadow: 0 0 0 2px var(--a1), 0 8px 32px var(--shadow);
}
.bts-member-card.active-member .bts-member-card-bg {
  filter: brightness(.6) saturate(1.2);
}

/* Матрица (cyberpunk-темы) — фиксированный слой на всю страницу */
.st-hero { position: relative; overflow: hidden; }
#matrix-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: .07;
  display: none;
  --matrix-color: #00ff41;
}
body[data-theme="terminal"] #matrix-bg,
body[data-theme="neon-t"] #matrix-bg,
body[data-theme="amber"] #matrix-bg { display: block; }
.st-hero > div { position: relative; z-index: 1; }

/* BTS-герой на главной */
.st-bts-hero {
  display: none;
  position: relative;
  min-height: 250px;
  border-radius: var(--st-radius-card);
  overflow: hidden;
  border: 1.5px solid var(--ig-border);
}
body[data-theme-group="bts"] .st-bts-hero { display: flex; }
body[data-theme-group="bts"] #stHeroGuest,
body[data-theme-group="bts"] #stHeroUser { display: none; }
.st-bts-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.st-bts-hero-meta {
  position: relative;
  z-index: 1;
  min-height: 250px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
}
.st-bts-hero .st-hero-name { color: #fff; }
.st-bts-hero .st-hero-sub { color: rgba(255, 255, 255, .75); margin-bottom: 0; }

@media (max-width: 899px) {
  .bts-member-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bts-member-card { height: 120px; }
  .bts-member-card-name { font-size: 16px; }
}
@media (max-width: 520px) {
  .bts-member-cards { grid-template-columns: 1fr; }
  .bts-member-card { height: 110px; }
  .bts-member-card-info { padding: 10px 12px; }
  .bts-member-card-name { font-size: 15px; }
  .st-bts-hero, .st-bts-hero-meta { min-height: 200px; }
}

/* ── 21. Фиксы внутренних страниц (index2–5): липкие шапки перекрывали контент ── */
body.st-shell .ig-container > .ig-header,
body.st-shell .ig-container > .ig-tabs {
  position: static !important;
  top: auto !important;
  z-index: auto;
}
body.st-shell #profileContent .profile-avatar-wrap {
  margin-top: 0 !important;
}