
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Страницы/суб-виды скрываются JS через атрибут hidden (el.hidden=true).
   Любое авторское display: на таком элементе побеждало бы UA-стиль и
   ломало роутинг — этот страж единственное осознанное исключение из
   запрета !important. НЕ удалять. */
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html { font-size: 100%; }  /* rem-база = настройка браузера пользователя */
html, body { margin: 0; padding: 0; }
body {
  background: var(--neo-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; }

/* Видимый фокус для клавиатуры (WCAG 2.4.7): только :focus-visible —
   мышиные клики ринг не рисуют */
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 3px; }

.page-bg { position: relative; z-index: 1; min-height: 100vh; }

/* ═══════════════ neumorphism surfaces ═══════════════ */
.glass, .neo {
  background: var(--neo-surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--neo-raised);
  position: relative;
  transition: background .25s ease, box-shadow .25s ease;
}
.glass-strong, .neo-strong {
  background: var(--neo-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neo-raised);
}
.glass-header, .neo-header {
  background: var(--neo-bg);
  box-shadow: var(--neo-flat);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
[data-theme="dark"] .glass-header,
[data-theme="dark"] .neo-header {
  border-bottom-color: rgba(255,255,255,0.04);
}
.glass-hover, .neo-hover {
  transition: box-shadow var(--dur-med) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.glass-hover:hover, .neo-hover:hover {
  box-shadow: 8px 8px 18px var(--neo-shadow-d), -8px -8px 18px var(--neo-shadow-l);
  transform: translateY(-1px);
}
.glass-inset, .neo-inset {
  background: var(--neo-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-inset);
}
.top-glow { display: none; }

/* ═══════════════ типографика ═══════════════ */
.gradient-text, .page-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

/* тач: убрать двойной-тап-зум/подсветку на контролах (десктоп не задет) */
button, a, .filter-chip { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.page-sub {
  color: var(--text-muted);
  font-size: var(--fs-body);
  font-weight: 500;
  margin: 0;
  line-height: 1.55;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ═══════════════ header / nav ═══════════════ */
header.top { position: sticky; top: 0; z-index: 40; }
.top-inner {
  max-width: min(1400px, 100%); margin: 0 auto;
  padding-block: 0; padding-inline: clamp(1rem, 0.6rem + 1.8vw, 1.5rem);
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.logo-btn {
  display: flex; align-items: center; gap: var(--space-3);
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text-primary); text-decoration: none;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--neo-surface); box-shadow: var(--neo-raised-sm);
}
.logo-text { font-family: var(--font-heading); font-weight: 800; font-size: 1.0625rem; }
.logo-text span { color: var(--accent); }

.top-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
  width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
  background: var(--neo-surface); color: var(--accent);
  box-shadow: var(--neo-flat); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover { box-shadow: var(--neo-inset); transform: scale(1.04); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

nav.top-nav { display: flex; gap: var(--space-2); }
nav.top-nav .nav-btn {
  font-size: var(--fs-base); font-weight: 600; cursor: pointer;
  color: var(--text-muted); background: var(--neo-surface);
  border: none; padding: var(--space-2) var(--space-4); border-radius: 999px;
  box-shadow: var(--neo-flat);
  transition: color var(--dur-fast) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out);
  text-decoration: none;
}
nav.top-nav .nav-btn:hover { color: var(--text-primary); }
nav.top-nav .nav-btn.active {
  color: var(--text-primary);
  box-shadow: var(--neo-inset);
  background: var(--accent-bg);
}
.guest-badge {
  font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500;
  background: var(--neo-surface); padding: var(--space-1) var(--space-3);
  border-radius: 999px; box-shadow: var(--neo-inset); font-family: var(--font-mono);
}

.demo-banner {
  text-align: center; padding: var(--space-2) var(--space-4);
  font-size: var(--fs-md); font-weight: 500;
  color: var(--text-muted); background: var(--accent-bg);
  box-shadow: var(--neo-inset);
}

/* ═══════════════ layout ═══════════════ */
.wrap {
  max-width: min(1400px, 100%); margin: 0 auto;
  padding-block: var(--space-6) var(--space-8);
  padding-inline: clamp(1rem, 0.6rem + 1.8vw, 1.5rem);
}
.page-intro { margin-block-end: var(--space-5); }
.page-intro .page-sub, .page-sub { max-width: 70ch; }
.section { margin-block-end: var(--space-6); }
.section-head {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section-head h2 {
  font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-xl); line-height: 1.2;
  color: var(--text-secondary); margin: 0;
}
.section-head .rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}
.empty {
  padding: var(--space-6) var(--space-5); text-align: center;
  color: var(--text-muted); font-size: var(--fs-body); font-weight: 500;
  border-radius: var(--radius-md); box-shadow: var(--neo-inset);
}
.empty::before {
  content: '◎'; display: block; font-size: 1.5rem; line-height: 1;
  color: var(--text-dim); margin-bottom: var(--space-2);
}
.err {
  background: var(--danger-soft); color: var(--danger);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  box-shadow: var(--neo-inset); margin-bottom: var(--space-4);
  font-size: var(--fs-base); font-weight: 600;
}
.updated {
  font-size: var(--fs-sm); color: var(--text-dim); text-align: right;
  margin-top: var(--space-3); font-family: var(--font-mono);
}

