:root {
  --theme-bg: #f3f6fc;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f7f9ff;
  --theme-text: #18243d;
  --theme-muted: #5f6d8c;
  --theme-primary: #243b84;
  --theme-primary-soft: #dbe4fb;
  --theme-border: #d4deef;
  --theme-shadow: 0 14px 36px rgba(31, 87, 195, 0.12);
  --theme-radius-lg: 22px;
  --theme-radius-md: 14px;
  --theme-font-body: "General Sans", "Inter", "Segoe UI", Arial, sans-serif;
  --theme-font-display: "Zodiak", "Georgia", "Times New Roman", serif;
  --theme-letter-tight: -0.012em;
  /* Единый ритм контента в карточках */
  --content-line: 1.72;
  --content-measure: 68ch;
  --card-pad: clamp(1.15rem, 2.2vw, 1.65rem);
  --card-stack: 0.85rem;
}

:root[data-theme="dark"] {
  --theme-bg: #101a30;
  --theme-surface: #16213a;
  --theme-surface-soft: #1c2948;
  --theme-text: #eef3ff;
  --theme-muted: #c7d4f3;
  --theme-primary: #8ab0ff;
  --theme-primary-soft: #243a69;
  --theme-border: #33456d;
  --theme-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: var(--theme-muted);
}

:focus-visible {
  outline: 2px solid var(--theme-primary);
  outline-offset: 3px;
}

body {
  background: radial-gradient(
    1200px 600px at 10% -5%,
    color-mix(in srgb, var(--theme-primary-soft) 72%, var(--theme-bg)) 0%,
    var(--theme-bg) 48%,
    var(--theme-bg) 100%
  );
  color: var(--theme-text);
  font-family: var(--theme-font-body);
  position: relative;
  transition: background-color 0.28s ease, color 0.28s ease;
}

html {
  scroll-behavior: smooth;
  /* Меньше сдвига макета при открытии/закрытии drawer (overflow: hidden убирает полосу прокрутки). */
  scrollbar-gutter: stable;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 14%, transparent) 25%, transparent 25%),
    linear-gradient(225deg, color-mix(in srgb, var(--theme-primary) 10%, transparent) 25%, transparent 25%);
  background-size: 44px 44px;
  background-position: 0 0, 22px 22px;
}


h1, h2, h3 {
  font-family: var(--theme-font-display);
  letter-spacing: var(--theme-letter-tight);
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.95rem, 1.4rem + 1.8vw, 2.75rem);
}

h2 {
  font-size: clamp(1.4rem, 1.15rem + 1vw, 2rem);
}

p, li {
  line-height: var(--content-line);
}

header.topbar {
  backdrop-filter: none;
  background: var(--topbar-bg, #243b84);
  border-bottom-color: var(--topbar-border, var(--theme-border));
}

header.topbar > .topbar-inner {
  gap: 0;
}

/* «Неравнодушным» + «Стать партнёром» в одной строке (переносятся вместе) */
.topbar-pair {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
}

/* Выпадающее меню при наведении на «Неравнодушным» */
.topbar-dropdown {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.topbar-dropdown__menu {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
  padding: 0.35rem;
  min-width: max(100%, 14.5rem);
  background: var(--theme-surface, var(--surface, #ffffff));
  border: 1px solid var(--theme-border, var(--border, #d4deef));
  border-radius: var(--theme-radius-md, var(--radius-md, 14px));
  box-shadow: var(--theme-shadow, 0 14px 36px rgba(31, 87, 195, 0.12));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.topbar-dropdown__menu::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 10px;
}

.topbar-dropdown:hover .topbar-dropdown__menu,
.topbar-dropdown:focus-within .topbar-dropdown__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.topbar-dropdown__link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--theme-text, var(--text, #18243d));
  white-space: nowrap;
}

.topbar-dropdown__link:hover {
  background: color-mix(in srgb, var(--theme-primary, var(--primary, #1f57c3)) 14%, transparent);
}

.topbar-dropdown__link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-primary, var(--primary, #1f57c3)) 82%, #ffffff);
  outline-offset: 2px;
}

/* Длинные подписи (оглавление «Вопросы и ответы» в шапке) */
.topbar-dropdown__menu--wide {
  min-width: max(100%, 17.5rem);
  max-width: min(calc(100vw - 2rem), 26rem);
}

header.topbar .topbar-dropdown__menu--wide .topbar-dropdown__link,
.topbar-dropdown__menu--wide .topbar-dropdown__link {
  white-space: normal;
  line-height: 1.38;
}

.btn,
.icon-btn,
.ghost-btn,
.cta,
.access-btn {
  transition: 0.2s ease;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.ghost-btn:focus-visible,
.cta:focus-visible,
.access-btn:focus-visible,
.doc-link:focus-visible,
.office-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-primary) 82%, #ffffff);
  outline-offset: 2px;
}

.btn:hover,
.icon-btn:hover,
.ghost-btn:hover,
.cta:hover,
.access-btn:hover {
  transform: translateY(-1px);
}

a {
  transition: color 0.22s ease, text-decoration-color 0.22s ease, background-color 0.22s ease;
}

.card,
.toolbar,
.topbar,
.topbar-dropdown__menu,
.access-btn,
.btn,
.icon-btn,
.ghost-btn {
  transition: background-color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, color 0.24s ease;
}

.btn:active,
.icon-btn:active,
.ghost-btn:active,
.cta:active,
.access-btn:active {
  transform: translateY(0);
}

.btn {
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-surface);
  color: var(--theme-text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(20, 60, 140, 0.06);
}

.btn.primary {
  background: var(--theme-primary);
  color: #fff;
  border-color: var(--theme-primary);
  box-shadow: 0 8px 18px rgba(31, 87, 195, 0.25);
}

.card,
.hero-copy,
.timeline-item,
.security-card,
.cta-band {
  border-radius: var(--theme-radius-lg);
  box-shadow: var(--theme-shadow);
}

.card-soft {
  background: var(--theme-surface-soft);
  box-shadow: none;
}

.card {
  border: 1px solid color-mix(in srgb, var(--theme-primary) 11%, var(--theme-border));
  padding: var(--card-pad);
  color: var(--theme-text);
}

/* Типографика внутри карточек — единые отступы и читаемость */
.card h1,
.card h2,
.card h3 {
  line-height: 1.22;
  margin: 0 0 var(--card-stack);
}

.card h1 + p,
.card h2 + p,
.card h3 + p {
  margin-top: 0;
}

.card p {
  margin: 0 0 var(--card-stack);
  max-width: var(--content-measure);
  color: var(--theme-text);
}

.card p:last-child,
.card ul:last-child,
.card ol:last-child {
  margin-bottom: 0;
}

.card .notice,
.card .muted {
  color: var(--theme-muted);
  line-height: 1.55;
}

.card ul,
.card ol {
  margin: 0 0 var(--card-stack);
  padding-left: 1.25rem;
  max-width: var(--content-measure);
  color: var(--theme-text);
}

.card li + li {
  margin-top: 0.35em;
}

.card a:not(.btn):not(.icon-btn):not(.ghost-btn):not(.cta):not(.access-btn) {
  color: var(--theme-primary);
  font-weight: 600;
  text-underline-offset: 0.15em;
}

.card figure,
.card img:not([class*="logo"]):not(.topbar-logo__img) {
  max-width: 100%;
}

/* Сетки карточек: ровный зазор между ячейками */
.grid-3 .card,
.grid-2 .card,
.value-grid .value-item {
  height: 100%;
}

.eyebrow {
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

.a11y-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1480;
  background: rgba(8, 18, 40, 0.45);
  backdrop-filter: blur(2px);
}

.a11y-backdrop[hidden] {
  display: none !important;
}

/* Старая панель .toolbar — не для #access-toolbar (новая панель в a11y-panel.css) */
.toolbar:not(#access-toolbar) {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0.7rem;
  transform: translateX(-50%);
  z-index: 1520;
  width: min(1040px, calc(100vw - 1rem));
  max-height: min(88vh, 840px);
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 24%, var(--theme-border));
  border-radius: 20px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.22),
    0 0 0 1px color-mix(in srgb, var(--theme-primary) 14%, transparent);
  background: var(--theme-surface, #ffffff);
  color: var(--theme-text, #18243d);
}

.toolbar:not(#access-toolbar)[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.toolbar:not(#access-toolbar).open:not([hidden]) {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

html.a11y-panel-open {
  overflow: hidden;
}

html.a11y-panel-open header.topbar {
  z-index: 1530;
}

#access-toolbar.toolbar--popover.open:not([hidden]) {
  z-index: 1540;
}

.toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-primary-soft) 70%, var(--theme-surface));
}

.toolbar-header strong {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
}

.toolbar-body {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem 1rem 1.2rem;
  max-height: calc(min(82vh, 720px) - 58px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.toolbar-body.a11y-v2 {
  gap: 0.95rem;
  grid-template-columns: 1fr;
  align-items: stretch;
  color: var(--theme-text);
  font-weight: 600;
  padding: 0.85rem 1rem 1rem;
  max-height: calc(min(82vh, 720px) - 58px);
  overflow: auto;
}

.toolbar-body.a11y-v3 {
  grid-auto-flow: row;
}

.toolbar-body.a11y-v2:not(.a11y-tabbed),
.toolbar-body.a11y-stable {
  display: grid;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(min(82vh, 720px) - 58px);
  -webkit-overflow-scrolling: touch;
}

.toolbar-body.a11y-stable .a11y-speech-panel {
  border: 2px solid color-mix(in srgb, var(--theme-primary) 28%, var(--theme-border));
  border-radius: 14px;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--theme-surface-soft) 55%, var(--theme-surface));
}

/* Вкладки: одна колонка, без двухколоночного хаоса */
.toolbar-body.a11y-tabbed {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  max-height: calc(min(82vh, 720px) - 58px);
  overflow: hidden;
}

.toolbar-body.a11y-tabbed .a11y-tabs {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, var(--theme-surface));
}

.a11y-tabs--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.a11y-panes {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.75rem 0.85rem 0.35rem;
  scrollbar-gutter: stable both-edges;
}

.a11y-pane {
  display: none !important;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.a11y-pane.is-active {
  display: grid !important;
}

.a11y-pane[hidden] {
  display: none !important;
}

.toolbar-body.a11y-tabbed .a11y-opt-group {
  grid-column: auto;
  background: var(--theme-surface, #fff);
  border-color: color-mix(in srgb, var(--theme-primary, #243b84) 22%, var(--theme-border, #c5d3ea));
}

.toolbar-body.a11y-tabbed .a11y-choice {
  min-height: 46px;
  font-size: 0.96rem;
}

.toolbar-body.a11y-tabbed .a11y-reset-wrap {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.55rem 0.85rem 0.85rem;
  position: static;
  background: var(--theme-surface);
  border-top: 1px solid var(--theme-border);
}

.toolbar-body.a11y-panel-pro .a11y-speech-top {
  margin-bottom: 0.35rem;
}

.toolbar-body.a11y-panel-pro .a11y-voice-studio {
  margin-top: 0;
}

.toolbar-body.a11y-panel-pro .a11y-voice-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.a11y-voice-quick-btn {
  min-height: 50px;
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  justify-content: center;
}

.a11y-voice-quick-btn.is-active {
  border-color: var(--theme-primary, #243b84);
  background: color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 72%, var(--theme-surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.a11y-speech-panel .a11y-speech-bar__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.a11y-speech-panel .a11y-speech-bar__main {
  min-height: 52px;
  font-size: 1.02rem;
  font-weight: 800;
}

.a11y-voice-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.a11y-voice-presets--secondary {
  margin-bottom: 0.65rem;
}

@media (max-width: 520px) {
  .a11y-tabs--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Панель для слабовидящих — стабильное окно по центру / снизу */
.toolbar.toolbar--a11y-sheet,
.toolbar.toolbar--popover {
  border-radius: 16px;
  background: var(--theme-surface, #ffffff);
  backdrop-filter: none;
  left: 50%;
  right: auto;
  bottom: 0.75rem;
  top: auto;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 1rem));
  max-height: min(88vh, 820px);
}

.toolbar.toolbar--popover .toolbar-header {
  flex-shrink: 0;
}

.toolbar.toolbar--popover .a11y-panel-close-btn {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #18243d);
  cursor: pointer;
}

.toolbar-body.a11y-compact {
  grid-template-columns: 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem 1rem;
}

.a11y-presets--compact {
  padding: 0.65rem 0.75rem;
}

.a11y-opt-row--presets,
.a11y-opt-row--speech {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.a11y-panel-block {
  padding: 0.75rem;
}

.a11y-font-stepper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.a11y-step-btn {
  min-height: 52px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--theme-primary) 28%, var(--theme-border));
  background: var(--theme-surface);
  color: var(--theme-text);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}

.a11y-step-btn:hover,
.a11y-step-btn:focus-visible {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
}

.a11y-step-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 0.5rem;
  border-radius: 12px;
  border: 1px dashed var(--theme-border);
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.a11y-scheme-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.a11y-scheme-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
  padding: 0.45rem 0.25rem 0.5rem;
  border: 2px solid var(--theme-border);
  border-radius: 12px;
  background: var(--theme-surface);
  cursor: pointer;
  font: inherit;
}

.a11y-scheme-tile.is-active {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.a11y-scheme-swatch {
  width: 100%;
  max-width: 3.2rem;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  position: relative;
}

.a11y-scheme-swatch::after {
  content: "";
  position: absolute;
  inset: 28% 18% auto 18%;
  height: 22%;
  border: 2px solid currentColor;
  border-radius: 40% 40% 0 0;
  opacity: 0.55;
}

.scheme-light {
  background: #ffffff;
  color: #1a2744;
}

.scheme-dark {
  background: #1a2744;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.scheme-blue {
  background: #e8f2fc;
  color: #1a3d6b;
}

.scheme-brown {
  background: #f3e8d8;
  color: #4a3218;
}

.scheme-contrast {
  background: #000000;
  color: #ffff00;
  border-color: #ffff00;
}

.a11y-scheme-caption {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  color: var(--theme-text);
}

.a11y-more {
  grid-column: 1 / -1;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  padding: 0.35rem 0.65rem 0.65rem;
  background: color-mix(in srgb, var(--theme-surface-soft) 90%, var(--theme-surface));
}

.a11y-more > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.45rem 0.15rem;
  list-style: none;
}

.a11y-more > summary::-webkit-details-marker {
  display: none;
}

.a11y-more__body {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.35rem;
}

.a11y-panel-close {
  font-size: 1.5rem !important;
  line-height: 1;
  min-width: 44px !important;
}

@media (min-width: 721px) {
  .toolbar.toolbar--popover {
    left: auto;
    right: max(0.65rem, calc((100vw - min(96%, 1280px)) / 2 + 0.35rem));
    bottom: auto;
    top: 7.25rem;
    transform: none;
    width: min(500px, calc(100vw - 1.25rem));
    max-height: min(78vh, 720px);
  }
}

@media (max-width: 720px) {
  .toolbar.toolbar--a11y-sheet,
  .toolbar.toolbar--a11y-sheet.open:not([hidden]),
  .toolbar.toolbar--popover,
  .toolbar.toolbar--popover.open:not([hidden]) {
    left: 0.5rem !important;
    right: 0.5rem !important;
    bottom: 0.5rem !important;
    top: auto !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    max-height: min(92vh, 820px) !important;
    border-radius: 14px !important;
  }

  .a11y-tabs--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .a11y-tab {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .a11y-scheme-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .a11y-scheme-tile--contrast {
    grid-column: span 1;
  }

  .a11y-scheme-caption {
    font-size: 0.62rem;
  }

  .a11y-opt-row {
    grid-template-columns: 1fr;
  }

  .a11y-opt-row--presets {
    grid-template-columns: 1fr;
  }
}

.a11y-section-heading {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--theme-primary, #243b84);
  border-top: 1px solid color-mix(in srgb, var(--theme-border) 80%, var(--theme-primary) 20%);
}

.a11y-section-heading:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.a11y-hotkeys {
  margin: 0;
  padding: 0.5rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.a11y-hotkeys-intro .notice + .notice {
  margin-top: 0.45rem;
}

.a11y-hotkeys kbd,
.a11y-hotkeys--footer kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 22%, var(--theme-border));
  background: color-mix(in srgb, var(--theme-surface-soft) 70%, var(--theme-surface));
  font: inherit;
  font-weight: 800;
  font-size: 0.9em;
  line-height: 1.2;
}

.a11y-hotkeys--footer {
  grid-column: 1 / -1;
  padding: 0.65rem 0.1rem 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.toolbar-body.a11y-v2 > .a11y-speech-bar {
  margin: 0 0 0.5rem;
  border-radius: 12px;
}

.a11y-speech-bar {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.85rem 1rem;
  border-bottom: 3px solid var(--theme-primary, #243b84);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 88%, var(--theme-surface, #fff)) 0%,
    var(--theme-surface, #fff) 100%
  );
  position: sticky;
  top: 0;
  z-index: 3;
}

.a11y-speech-bar__status {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--theme-text, #18243d);
}

.a11y-speech-bar__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: stretch;
}

.a11y-speech-bar__main,
.a11y-speech-toggle-btn.is-on {
  min-height: 64px;
  font-size: 1.12rem;
  font-weight: 800;
  text-align: center;
  justify-content: center;
  border-width: 2px;
  border-radius: 12px;
}

.a11y-speech-bar__main {
  grid-column: 1 / -1;
}

.a11y-speech-toggle-btn.is-on,
.a11y-speech-bar__main.is-on {
  background: #1b7a3a !important;
  border-color: #0d5c2a !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, #1b7a3a 35%, transparent);
}

.a11y-speech-bar__test {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}

.toolbar-body.a11y-tabbed .a11y-speech-bar {
  margin: 0 0 0.5rem;
}

@media (max-width: 520px) {
  .a11y-speech-bar__actions {
    grid-template-columns: 1fr;
  }

  .a11y-speech-bar__test {
    width: 100%;
  }
}

.a11y-voice-studio {
  border: 2px solid color-mix(in srgb, var(--theme-primary, #243b84) 42%, var(--theme-border));
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 72%, var(--theme-surface, #fff)) 0%,
    var(--theme-surface, #fff) 92%
  );
  padding: 1rem;
  gap: 0.75rem;
}

.a11y-voice-studio > .a11y-opt-title {
  font-size: 1.18rem;
  margin-bottom: 0.15rem;
}

.a11y-voice-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.a11y-voice-preset-btn {
  min-height: 54px;
  font-size: 1.02rem;
  font-weight: 800;
  text-align: center;
  justify-content: center;
  border-width: 2px;
}

.a11y-voice-preset-btn.is-active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-primary) 35%, transparent);
}

.a11y-voice-sliders {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

@media (min-width: 640px) {
  .a11y-voice-presets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .a11y-voice-sliders {
    grid-template-columns: 1fr 1fr;
  }
}

.a11y-slider-card {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, var(--theme-surface));
  display: grid;
  gap: 0.45rem;
}

.a11y-slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.a11y-slider-title {
  font-size: 1rem;
  font-weight: 800;
}

.a11y-slider-head strong {
  font-size: 1.08rem;
  color: var(--theme-primary);
}

.a11y-slider-stepper {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.a11y-range-input {
  width: 100%;
  min-height: 28px;
  accent-color: var(--theme-primary, #243b84);
}

.a11y-voice-pick {
  display: grid;
  gap: 0.45rem;
}

.a11y-voice-pick__label {
  font-size: 1rem;
  font-weight: 800;
}

.a11y-jaws-more > summary {
  font-size: 1rem;
}

.a11y-room-link-card {
  border: 2px dashed color-mix(in srgb, var(--theme-primary) 35%, var(--theme-border));
  background: color-mix(in srgb, var(--theme-primary-soft) 55%, var(--theme-surface));
}

.a11y-studio-room-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  text-align: center;
  font-weight: 800;
  text-decoration: none;
  border-width: 2px;
  color: var(--theme-text);
}

.a11y-speech-mini-status {
  margin: 0;
  font-size: 0.88rem;
}

.a11y-gost-note {
  border-style: dashed;
  background: color-mix(in srgb, var(--theme-surface-soft) 94%, var(--theme-surface));
}

.a11y-gost-note .notice {
  margin: 0;
}

.a11y-intro {
  grid-column: 1 / -1;
  border: 2px solid color-mix(in srgb, var(--theme-primary) 24%, var(--theme-border));
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--theme-primary-soft) 76%, var(--theme-surface)) 0%,
    var(--theme-surface) 88%
  );
}

.a11y-intro .notice {
  margin: 0;
  font-size: 1.04rem;
  color: var(--theme-text);
  font-weight: 600;
}

.a11y-simple-mode {
  grid-column: 1 / -1;
}

.a11y-opt-group {
  border: 1px solid color-mix(in srgb, var(--theme-primary) 12%, var(--theme-border));
  border-radius: 14px;
  padding: 0.9rem;
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, var(--theme-surface));
  display: grid;
  gap: 0.6rem;
}

.a11y-opt-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
  color: var(--theme-text);
  letter-spacing: 0.01em;
}

.a11y-opt-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.a11y-opt-row--quad {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.a11y-opt-row--duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.a11y-opt-row--speech-hero {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.a11y-speech-hero {
  border: 2px solid color-mix(in srgb, var(--theme-primary) 38%, var(--theme-border));
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--theme-primary-soft) 82%, var(--theme-surface)) 0%,
    var(--theme-surface) 92%
  );
}

.a11y-jaws {
  border: 2px solid color-mix(in srgb, var(--theme-primary) 42%, var(--theme-border));
  background: color-mix(in srgb, var(--theme-primary-soft) 55%, var(--theme-surface));
}

.a11y-jaws .a11y-opt-title::before {
  content: "♿ ";
}

.a11y-jaws-preset-btn {
  min-height: 62px !important;
  font-size: 1.05rem !important;
  border-color: var(--theme-primary) !important;
  background: color-mix(in srgb, var(--theme-primary-soft) 70%, var(--theme-surface)) !important;
}

@media (min-width: 560px) {
  .a11y-opt-row--quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 559px) {
  .a11y-opt-row--speech-hero {
    grid-template-columns: 1fr;
  }
}

.a11y-choice {
  min-height: 58px;
  justify-content: center;
  text-align: center;
  font-size: 1.08rem;
  line-height: 1.25;
  padding: 0.5rem 0.65rem;
  font-weight: 800;
  border-width: 2px;
}

.a11y-choice.is-active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme-primary) 40%, transparent);
}

.a11y-reset-wrap {
  display: grid;
  grid-column: 1 / -1;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--theme-surface) 92%, #fff 8%) 28%);
  padding-top: 0.45rem;
}

/* Simple mode: one column, bigger controls, less visual noise */
:root[data-a11y-simple="on"] .toolbar .toolbar-body.a11y-v2 {
  grid-template-columns: 1fr !important;
  gap: 0.8rem;
}

:root[data-a11y-simple="on"] .toolbar .a11y-opt-group {
  padding: 1rem;
}

:root[data-a11y-simple="on"] .toolbar .a11y-choice,
:root[data-a11y-simple="on"] .toolbar .a11y-live-voice,
:root[data-a11y-simple="on"] .toolbar .a11y-super-zoom {
  min-height: 72px;
  font-size: 1.18rem;
}

:root[data-a11y-simple="on"] .toolbar .a11y-opt-title {
  font-size: 1.2rem;
}

:root[data-a11y-simple="on"] .toolbar .a11y-opt-title::before {
  display: none !important;
}

.a11y-reset-btn {
  text-align: center;
  justify-content: center;
}

.a11y-voice-tools {
  grid-column: 1 / -1;
}

.a11y-voice-tools .a11y-voice-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.a11y-voice-tools .a11y-voice-quick-btn {
  min-height: 50px;
  font-weight: 800;
  text-align: center;
  justify-content: center;
}

.a11y-voice-hint--warn {
  color: #8a1f1f;
  font-weight: 800;
  border-left: 3px solid #c62828;
  padding-left: 0.55rem;
}

.a11y-voice-select {
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  font: inherit;
  padding: 0.5rem 0.65rem;
  font-size: 1.02rem;
}

.a11y-rate-row {
  display: grid;
  gap: 0.35rem;
}

.a11y-rate-row label {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--theme-text);
}

.a11y-rate-row input[type="range"] {
  width: 100%;
}

.a11y-live-voice {
  justify-content: center;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
}

.a11y-super-zoom {
  justify-content: center;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
}

.toolbar .access-btn,
.toolbar .a11y-voice-select,
.toolbar .a11y-rate-row label,
.toolbar .sr-panel,
.toolbar .notice {
  color: var(--theme-text);
}

.toolbar .notice {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.5;
}

.a11y-presets {
  grid-column: 1 / -1;
  border: 2px solid color-mix(in srgb, var(--theme-primary) 30%, var(--theme-border));
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--theme-primary-soft) 74%, var(--theme-surface)) 0%,
    var(--theme-surface) 90%
  );
}

.a11y-presets .a11y-choice {
  min-height: 62px;
  font-size: 1.12rem;
}


.toolbar .access-btn {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

:root[data-theme="dark"] .toolbar .access-btn,
:root[data-theme="dark"] .toolbar .a11y-voice-select {
  border-color: color-mix(in srgb, var(--theme-border) 70%, #ffffff 30%);
}

:root[data-theme="dark"] .toolbar .a11y-opt-group {
  background: color-mix(in srgb, var(--theme-surface-soft) 86%, #0f1a2f 14%);
}

/* Super large mode only for accessibility panel */
:root[data-a11y-panel-zoom="super"] .toolbar .toolbar-body.a11y-v2 {
  font-size: 1.2rem;
}

:root[data-a11y-panel-zoom="super"] .toolbar .a11y-opt-title {
  font-size: 1.25rem;
}

:root[data-a11y-panel-zoom="super"] .toolbar .a11y-choice,
:root[data-a11y-panel-zoom="super"] .toolbar .a11y-live-voice,
:root[data-a11y-panel-zoom="super"] .toolbar .a11y-super-zoom {
  min-height: 62px;
  font-size: 1.16rem;
}

:root[data-a11y-panel-zoom="super"] .toolbar .a11y-rate-row label {
  font-size: 1.12rem;
}

:root[data-a11y-panel-zoom="super"] .toolbar .a11y-voice-select {
  min-height: 54px;
  font-size: 1.08rem;
}

.toolbar-body::after {
  content: "";
  display: block;
  height: 0.4rem;
}

.a11y-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.a11y-tab {
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  text-align: center;
}

.a11y-tab.is-active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

.toolbar-body:not(.a11y-tabbed) .a11y-pane {
  display: none !important;
}

.toolbar-body:not(.a11y-tabbed) .a11y-pane.is-active {
  display: grid !important;
  gap: 0.7rem;
}

.toolbar-body.a11y-tabbed .a11y-pane.is-active {
  gap: 0.75rem;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.access-btn {
  border-radius: 12px;
  min-height: 44px;
  border: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface) 92%, var(--theme-surface-soft));
  color: var(--theme-text);
  padding: 0.62rem 0.76rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
}

.access-btn[aria-pressed="true"] {
  background: var(--theme-primary-soft);
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.voice-controls {
  border: 1px solid color-mix(in srgb, var(--theme-primary) 12%, var(--theme-border));
  border-radius: 12px;
  padding: 0.78rem;
  background: color-mix(in srgb, var(--theme-surface-soft) 82%, var(--theme-surface));
  display: grid;
  gap: 0.5rem;
}

.voice-controls h4,
.sr-panel h4 {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  color: var(--theme-primary);
}

.voice-controls label {
  font-size: 0.86rem;
  color: var(--theme-muted);
}

.voice-controls select,
.voice-controls input[type="range"] {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  padding-inline: 0.45rem;
}

.notice {
  color: var(--theme-muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  line-height: 1.4;
}

.sr-panel {
  border: 1px solid color-mix(in srgb, var(--theme-primary) 12%, var(--theme-border));
  border-radius: 12px;
  padding: 0.72rem 0.76rem;
  background: color-mix(in srgb, var(--theme-surface-soft) 80%, var(--theme-surface));
  color: var(--theme-text);
}

.toolbar .notice:last-child {
  margin-bottom: 0.1rem;
}

@media (max-width: 640px) {
  .toolbar {
    left: 50%;
    right: auto;
    bottom: 0.5rem;
    transform: translateX(-50%);
    width: calc(100vw - 1rem);
    max-height: 84vh;
  }

  .toolbar-body.a11y-v2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .toolbar {
    left: 0.35rem;
    right: 0.35rem;
    transform: none;
    width: auto;
    bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
    max-height: 88vh;
    border-radius: 14px;
  }

  .toolbar-header {
    padding: 0.72rem 0.78rem;
  }

  .toolbar-header strong {
    font-size: 1rem;
  }

  .toolbar-body {
    padding: 0.72rem;
  }
}

:root[data-contrast="high"] {
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #ffffff;
  --theme-text: #000000;
  --theme-muted: #111111;
  --theme-border: #000000;
}

:root[data-theme="dark"][data-contrast="high"],
html[data-a11y-on][data-a11y-scheme="dark"][data-a11y-contrast="high"],
html[data-a11y-on][data-a11y-scheme="dark"][data-contrast="high"] {
  --theme-bg: #000000;
  --theme-surface: #000000;
  --theme-surface-soft: #000000;
  --theme-text: #ffffff;
  --theme-muted: #ffffff;
  --theme-border: #ffffff;
}

/* Accessibility presets v2 */
:root[data-a11y-scheme="light"] {
  --theme-bg: #f3f6fc;
  --theme-surface: #ffffff;
  --theme-surface-soft: #f7f9ff;
  --theme-text: #18243d;
  --theme-muted: #5f6d8c;
  --theme-primary: #243b84;
  --theme-primary-soft: #dbe4fb;
  --theme-border: #d4deef;
}

:root[data-a11y-scheme="dark"] {
  --theme-bg: #101a30;
  --theme-surface: #16213a;
  --theme-surface-soft: #1c2948;
  --theme-text: #eef3ff;
  --theme-muted: #c7d4f3;
  --theme-primary: #8ab0ff;
  --theme-primary-soft: #243a69;
  --theme-border: #33456d;
}

:root[data-a11y-scheme="blue"] {
  --theme-bg: #e8f4ff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #edf7ff;
  --theme-text: #0f2f57;
  --theme-muted: #31537c;
  --theme-primary: #1b5fa8;
  --theme-primary-soft: #d1e8ff;
  --theme-border: #b8d4f2;
}

:root[data-a11y-scheme="brown"] {
  --theme-bg: #f6f0e7;
  --theme-surface: #fffaf4;
  --theme-surface-soft: #f4eadc;
  --theme-text: #3e2b1d;
  --theme-muted: #6a513f;
  --theme-primary: #7b4a1f;
  --theme-primary-soft: #eddcc6;
  --theme-border: #d7bea4;
}

/* Масштаб текста — шаг задаётся в a11y-controls.js (--voi-a11y-font-mult), только main и подвал */
:root main,
:root .official-footer {
  font-size: calc(100% * var(--voi-a11y-font-mult, 1));
}

:root[data-a11y-letter-spacing="standard"] main,
:root[data-a11y-letter-spacing="standard"] .official-footer {
  letter-spacing: 0;
}

:root[data-a11y-letter-spacing="medium"] main,
:root[data-a11y-letter-spacing="medium"] .official-footer {
  letter-spacing: 0.02em;
}

:root[data-a11y-letter-spacing="large"] main,
:root[data-a11y-letter-spacing="large"] .official-footer {
  letter-spacing: 0.045em;
}

:root[data-a11y-line-spacing="standard"] main,
:root[data-a11y-line-spacing="standard"] .official-footer {
  line-height: 1.6;
}

:root[data-a11y-line-spacing="medium"] main,
:root[data-a11y-line-spacing="medium"] .official-footer {
  line-height: 1.85;
}

:root[data-a11y-line-spacing="large"] main,
:root[data-a11y-line-spacing="large"] .official-footer {
  line-height: 2.1;
}

:root[data-a11y-font-family="serif"] main,
:root[data-a11y-font-family="serif"] .official-footer {
  font-family: "Georgia", "Times New Roman", serif;
}

:root[data-a11y-font-family="sans"] main,
:root[data-a11y-font-family="sans"] .official-footer {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

:root[data-a11y-font-family="dyslexic"] main,
:root[data-a11y-font-family="dyslexic"] .official-footer {
  font-family: "OpenDyslexic", "Arial", "Verdana", sans-serif;
}

:root[data-a11y-images="bw"] img {
  filter: grayscale(1) contrast(1.05);
}

:root[data-a11y-images="none"] img {
  opacity: 0 !important;
}

:root[data-a11y-contrast="high"]:not([data-a11y-scheme="dark"]) {
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-soft: #ffffff;
  --theme-text: #000000;
  --theme-muted: #111111;
  --theme-primary: #002b7f;
  --theme-primary-soft: #dfe9ff;
  --theme-border: #000000;
}

:root[data-a11y-contrast="high"] .toolbar .a11y-opt-group,
:root[data-a11y-contrast="high"] .toolbar .access-btn,
:root[data-a11y-contrast="high"] .toolbar .a11y-voice-select {
  border-color: #000000 !important;
  color: #000000 !important;
  background: #ffffff !important;
}

:root[data-a11y-contrast="high"] .toolbar .a11y-choice.is-active {
  background: #002b7f !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}

:root[data-spacing="wide"] body {
  line-height: 1.95;
}

:root[data-spacing="wide"] p,
:root[data-spacing="wide"] li {
  letter-spacing: 0.02em;
}

:root[data-images="off"] img {
  filter: grayscale(1) opacity(0.2);
}

:root[data-links="underlined"] a {
  text-decoration: underline;
}

:root[data-font-scale="lg"] {
  font-size: 112.5%;
}

:root[data-font-scale="xl"] {
  font-size: 125%;
}

.site-signature {
  margin: 1.2rem auto 2rem;
  width: min(var(--theme-container, 1180px), calc(100% - 2rem));
  border-top: 1px solid var(--theme-border);
  padding-top: 0.9rem;
  color: var(--theme-muted);
  font-size: 0.92rem;
  text-align: center;
}

.official-footer {
  padding: 1.4rem 0 0.2rem;
}

.official-footer-grid {
  width: min(var(--theme-container, 1180px), calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.official-footer-card {
  padding: 1rem 1.2rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 88%, var(--theme-primary) 12%);
  background: linear-gradient(135deg, var(--theme-surface-soft) 0%, var(--theme-surface) 100%);
  box-shadow: 0 10px 26px rgba(20, 45, 95, 0.08);
  color: var(--theme-text);
}

.official-footer-card h3 {
  margin: 0 0 0.6rem;
  letter-spacing: 0.01em;
  color: var(--theme-text);
}

.official-footer-card .notice,
.official-footer-card p {
  color: var(--theme-text);
}

.official-footer-card .notice strong {
  color: var(--theme-text);
}

.official-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.official-footer-nav a {
  text-decoration: none;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 82%, var(--theme-primary) 18%);
  background: var(--theme-surface-soft);
  color: var(--theme-text);
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.official-footer-nav a:hover {
  border-color: color-mix(in srgb, var(--theme-primary) 45%, var(--theme-border));
  background: color-mix(in srgb, var(--theme-primary-soft) 40%, var(--theme-surface-soft));
  color: var(--theme-text);
  transform: translateY(-1px);
}

/* Подвал: навигация и заголовки в тёмной теме (◐ и палитра «для слабовидящих») */
:root[data-theme="dark"] .official-footer,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer {
  color: var(--theme-text);
}

:root[data-theme="dark"] .official-footer-card,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .official-footer-card h3,
:root[data-theme="dark"] .official-footer-card p,
:root[data-theme="dark"] .official-footer-card .notice,
:root[data-theme="dark"] .official-footer-card .notice strong,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card h3,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card p,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card .notice,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card .notice strong {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .official-footer-card a:not(.official-footer-nav a):not(.footer-social-link),
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card a:not(.official-footer-nav a):not(.footer-social-link) {
  color: var(--theme-primary) !important;
}

:root[data-theme="dark"] .official-footer-nav a,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-nav a {
  background: var(--theme-surface-soft) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .official-footer-nav a:hover,
html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-nav a:hover {
  background: color-mix(in srgb, var(--theme-primary-soft) 55%, var(--theme-surface-soft)) !important;
  color: #ffffff !important;
  border-color: color-mix(in srgb, var(--theme-primary) 50%, var(--theme-border)) !important;
}

.qr-footer {
  width: min(var(--theme-container, 1180px), calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 1rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 18%, var(--theme-border));
  border-radius: 18px;
  background: linear-gradient(140deg, var(--theme-primary-soft) 0%, var(--theme-surface) 100%);
  color: var(--theme-text);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.95rem;
  align-items: center;
}

.qr-footer__codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.qr-footer__item {
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  padding: 0.7rem;
  background: var(--theme-surface-soft);
  color: var(--theme-text);
}

.qr-footer__item strong {
  display: block;
  margin-bottom: 0.45rem;
}

.qr-footer img {
  width: clamp(170px, 22vw, 230px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  border: 1px solid var(--theme-border);
  background: #fff;
  padding: 0.35rem;
  image-rendering: pixelated;
}

:root[data-theme="dark"] .qr-footer img {
  background: #ffffff;
  border-color: var(--theme-border);
}

:root[data-theme="dark"] .qr-footer,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer {
  background: var(--theme-surface) !important;
  background-image: none !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .qr-footer strong,
:root[data-theme="dark"] .qr-footer div,
:root[data-theme="dark"] .qr-footer .bank-details,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer strong,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer div,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer .bank-details {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .qr-footer .bank-details,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer .bank-details {
  color: var(--theme-muted) !important;
}

:root[data-theme="dark"] .qr-footer a,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer a {
  color: var(--theme-primary) !important;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  font-weight: 700;
}

:root[data-theme="dark"] .qr-footer a:hover,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer a:hover {
  color: #ffffff !important;
}

:root[data-theme="dark"] .qr-footer__item,
html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer__item {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

/* «Неравнодушным»: карточка с QR — без светлого градиента в тёмной теме */
:root[data-theme="dark"] .nerav-page .ner-hero-card,
html[data-a11y-on][data-a11y-scheme="dark"] .nerav-page .ner-hero-card {
  background: var(--theme-surface) !important;
  background-image: none !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .nerav-page .ner-hero-card .qr-footer,
html[data-a11y-on][data-a11y-scheme="dark"] .nerav-page .ner-hero-card .qr-footer {
  width: 100%;
  margin-top: 1.25rem;
}

.qr-footer strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.06rem;
  color: var(--theme-text);
}

.qr-footer a {
  color: var(--theme-primary);
  font-weight: 700;
}

.files {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.files a {
  color: var(--theme-primary);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--theme-primary) 38%, transparent);
  width: fit-content;
}

.files a:hover {
  text-decoration: underline;
}

.brand-accent-bar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #1f57c3 0%, #5a86e7 45%, #8ab0ff 100%);
}

.brand-note {
  width: min(var(--theme-container, 1180px), calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--theme-primary-soft) 88%, var(--theme-surface)), var(--theme-surface));
  color: var(--theme-text);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.brand-note a {
  color: var(--theme-primary);
  font-weight: 700;
}

@media (max-width: 760px) {
  main .container,
  .official-footer .container,
  .official-footer-grid,
  .qr-footer,
  .brand-note {
    width: calc(100% - 1rem) !important;
  }

  .card {
    padding: 0.82rem;
    border-radius: 14px;
  }

  body::before {
    opacity: 0.11;
    background-size: 34px 34px;
    background-position: 0 0, 17px 17px;
  }


  .brand-note {
    padding: 0.75rem 0.85rem;
  }

  .qr-footer {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .qr-footer img {
    width: min(62vw, 220px);
    height: auto;
  }

  .official-footer-grid {
    grid-template-columns: 1fr;
  }

  .a11y-opt-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .premium-page-arrows {
    display: none;
  }
}

.site-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(92, 146, 255, 0.22) 0%, rgba(92, 146, 255, 0) 42%),
    linear-gradient(145deg, #081127 0%, #0b1e47 58%, #0f2e71 100%);
  color: #fff;
  padding: 1rem;
  overflow: hidden;
}

.site-intro[hidden] {
  display: none !important;
}

.site-intro__box {
  width: min(920px, calc(100% - 1rem));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: static;
  z-index: 2;
  text-align: center;
}

.site-intro__logo {
  width: clamp(220px, 58vw, 700px);
  height: clamp(220px, 58vw, 700px);
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  margin: 0 auto;
  box-shadow:
    0 16px 34px rgba(2, 8, 24, 0.38),
    0 0 46px rgba(106, 159, 255, 0.16);
  animation: introPulse 2.4s ease-in-out infinite;
}

@keyframes introPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(111, 167, 255, 0)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 0 16px rgba(111, 167, 255, 0.32)); }
}

.site-intro__skip {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.site-intro__skip:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.62);
}

.site-intro::before {
  content: none;
}

/* Premium cross-page navigation */
.page-fade-enabled {
  opacity: 1;
  transition: opacity 170ms ease;
}

.page-fade-enabled.page-is-leaving {
  opacity: 0;
}

.premium-page-arrows {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 72;
  pointer-events: none;
}

.premium-page-arrow {
  position: absolute;
  pointer-events: auto;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--theme-primary, #1f57c3) 40%, var(--theme-border, #d4deef));
  background: color-mix(in srgb, var(--theme-surface, #fff) 86%, var(--theme-primary-soft, #e9f0ff));
  color: var(--theme-text, #18243d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(19, 43, 91, 0.16);
  font-size: 1.15rem;
  font-weight: 800;
}

.premium-page-arrow:hover {
  background: color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 66%, #fff);
}

.premium-page-arrow--prev {
  left: max(0.6rem, env(safe-area-inset-left, 0px));
}

.premium-page-arrow--next {
  right: max(0.6rem, env(safe-area-inset-right, 0px));
}


.premium-page-arrow__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.premium-next-wrap {
  margin-top: 1rem;
}

.premium-next-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--theme-primary, #1f57c3) 22%, var(--theme-border, #d4deef));
  border-radius: 16px;
  padding: 1rem 1.05rem;
  background: linear-gradient(130deg, color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 45%, #fff), #fff);
}

.premium-next-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--theme-muted, #5f6d8c);
  font-weight: 800;
}

.premium-next-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.premium-next-desc {
  margin: 0;
  color: var(--theme-muted, #5f6d8c);
}

.premium-next-btn {
  border: 1px solid color-mix(in srgb, var(--theme-primary, #1f57c3) 48%, var(--theme-border, #d4deef));
  border-radius: 999px;
  padding: 0.48rem 0.95rem;
  font-weight: 800;
  color: var(--theme-text, #18243d);
  text-decoration: none;
  background: #fff;
  white-space: nowrap;
}

.premium-next-btn:hover {
  background: color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 55%, #fff);
}

@media (max-width: 980px) {
  .premium-page-arrows {
    top: auto;
    bottom: max(0.8rem, env(safe-area-inset-bottom, 0px));
    transform: none;
  }

  .premium-page-arrow--prev {
    left: 0.7rem;
  }

  .premium-page-arrow--next {
    right: 0.7rem;
  }

  .premium-next-card {
    grid-template-columns: 1fr;
  }

  .premium-next-btn {
    justify-self: start;
  }
}


@media (prefers-reduced-motion: reduce) {
  .page-fade-enabled {
    transition: none;
  }
}

/* Unified premium look: about + documents + faq */
body[data-cms-page="about"] h1,
body[data-cms-page="documents"] h1,
body[data-cms-page="faq"] h1 {
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
}

body[data-cms-page="about"] .section-head,
body[data-cms-page="documents"] .section-head,
body[data-cms-page="faq"] .section-h2 {
  font-size: clamp(1.28rem, 1.8vw, 1.55rem);
  line-height: 1.25;
}

body[data-cms-page="about"] .about-quick-nav a,
body[data-cms-page="documents"] .doc-quick-nav a,
body[data-cms-page="faq"] .faq-toc a {
  font-weight: 800;
}

body[data-cms-page="about"] .map-actions a,
body[data-cms-page="documents"] .file-doc-actions a,
body[data-cms-page="documents"] .doc-quick-nav a,
body[data-cms-page="faq"] .ner-more a,
body[data-cms-page="bezbariernaya"] .ner-more a {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--theme-primary, #1f57c3) 40%, var(--theme-border, #d4deef));
  padding: 0.35rem 0.78rem;
  min-height: 2.35rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  color: var(--theme-text, #18243d);
  background: color-mix(in srgb, var(--theme-surface, #fff) 88%, var(--theme-primary-soft, #e9f0ff));
  transition: border-color 0.18s ease, background 0.18s ease;
}

body[data-cms-page="about"] .map-actions a:hover,
body[data-cms-page="documents"] .file-doc-actions a:hover,
body[data-cms-page="documents"] .doc-quick-nav a:hover,
body[data-cms-page="faq"] .ner-more a:hover,
body[data-cms-page="bezbariernaya"] .ner-more a:hover {
  border-color: color-mix(in srgb, var(--theme-primary, #1f57c3) 60%, var(--theme-border, #d4deef));
  background: color-mix(in srgb, var(--theme-surface, #fff) 72%, var(--theme-primary-soft, #e9f0ff));
}

body[data-cms-page="faq"] .ner-more a:focus-visible,
body[data-cms-page="bezbariernaya"] .ner-more a:focus-visible,
body[data-cms-page="documents"] .doc-quick-nav a:focus-visible,
body[data-cms-page="about"] .about-quick-nav a:focus-visible {
  outline: 2px solid var(--theme-primary, #1f57c3);
  outline-offset: 2px;
}

.footer-social {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--theme-primary, #1f57c3) 40%, var(--theme-border, #d4deef));
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  background: #fff;
  color: var(--theme-text, #18243d);
  font-weight: 700;
  line-height: 1;
}

.footer-social-link:hover {
  background: color-mix(in srgb, var(--theme-primary-soft, #e9f0ff) 55%, #fff);
  border-color: color-mix(in srgb, var(--theme-primary, #1f57c3) 58%, var(--theme-border, #d4deef));
}

.footer-social-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

/* Dark-mode hardening for page-level inline styles */
:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .events-plan-wrap,
:root[data-theme="dark"] .events-plan-card,
:root[data-theme="dark"] .partners-wrap,
:root[data-theme="dark"] .partner-card,
:root[data-theme="dark"] .home-survey,
:root[data-theme="dark"] .home-survey__q,
:root[data-theme="dark"] .home-survey__grant-block,
:root[data-theme="dark"] .masterclass-card,
:root[data-theme="dark"] .mc-mem,
:root[data-theme="dark"] .file-doc-row,
:root[data-theme="dark"] .docs-files-toolbar,
:root[data-theme="dark"] .docs-filter-empty,
:root[data-theme="dark"] .doc-inline-dialog,
:root[data-theme="dark"] .doc-inline-head,
:root[data-theme="dark"] .doc-list-reset li,
:root[data-theme="dark"] .doc-inline-btn,
:root[data-theme="dark"] .kpi-item,
:root[data-theme="dark"] .map-card,
:root[data-theme="dark"] .about-quick-nav a,
:root[data-theme="dark"] .doc-quick-nav a,
:root[data-theme="dark"] body[data-cms-page="faq"] .ner-more a,
:root[data-theme="dark"] body[data-cms-page="bezbariernaya"] .ner-more a,
:root[data-theme="dark"] .official-footer-card,
:root[data-theme="dark"] .official-footer-nav a,
:root[data-theme="dark"] .footer-social-link {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] body[data-cms-page="faq"] .ner-more a:hover,
:root[data-theme="dark"] body[data-cms-page="bezbariernaya"] .ner-more a:hover,
:root[data-theme="dark"] .about-quick-nav a:hover,
:root[data-theme="dark"] .doc-quick-nav a:hover {
  background: color-mix(in srgb, var(--theme-primary-soft) 42%, var(--theme-surface)) !important;
  border-color: color-mix(in srgb, var(--theme-primary) 55%, var(--theme-border)) !important;
}

:root[data-theme="dark"] .hero-kicker,
:root[data-theme="dark"] .events-plan-card__meta,
:root[data-theme="dark"] .mc-stats,
:root[data-theme="dark"] .doc-summary,
:root[data-theme="dark"] .notice,
:root[data-theme="dark"] .muted {
  color: var(--theme-muted) !important;
}

:root[data-theme="dark"] .home-survey__btn--primary,
:root[data-theme="dark"] .mc-submit,
:root[data-theme="dark"] .events-plan-form .btn-e {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-primary) !important;
}

:root[data-theme="dark"] .home-survey__txt,
:root[data-theme="dark"] .home-survey__ta,
:root[data-theme="dark"] .home-survey__row input,
:root[data-theme="dark"] .mc-form input[type="text"],
:root[data-theme="dark"] .mc-form input[type="number"],
:root[data-theme="dark"] .mc-form input[type="tel"],
:root[data-theme="dark"] .docs-search-wrap input,
:root[data-theme="dark"] .docs-search-wrap button {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

/* Новости VK: принудительная темная тема для карточек и подложек */
:root[data-theme="dark"] .vk-news-layout,
:root[data-theme="dark"] #vk-news-cards .vk-post,
:root[data-theme="dark"] #vk-news-cards .card,
:root[data-theme="dark"] #vk-news-cards .vk-feed-note,
:root[data-theme="dark"] .hero-card {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] #vk-news-cards .vk-post p,
:root[data-theme="dark"] #vk-news-cards .card p,
:root[data-theme="dark"] .vk-news-meta {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] #vk-news-cards .vk-post .vk-post-date,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post .vk-post-date {
  color: var(--theme-bg) !important;
  background: color-mix(in srgb, var(--theme-primary) 75%, var(--theme-surface-soft)) !important;
  border-color: var(--theme-primary) !important;
}

:root[data-theme="dark"] #vk-news-cards .vk-post p:last-child a,
:root[data-theme="dark"] #vk-news-cards .card p:last-child a,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post p:last-child a,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .card p:last-child a {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-primary) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

:root[data-theme="dark"] #vk-news-cards .vk-post p:last-child a:hover,
:root[data-theme="dark"] #vk-news-cards .card p:last-child a:hover,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post p:last-child a:hover,
html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .card p:last-child a:hover {
  background: color-mix(in srgb, var(--theme-primary) 88%, #ffffff) !important;
  color: var(--theme-bg) !important;
  border-color: color-mix(in srgb, var(--theme-primary) 88%, #ffffff) !important;
}

:root[data-theme="dark"] .vk-cta-btn,
html[data-a11y-on][data-a11y-scheme="dark"] .vk-cta-btn {
  background: var(--theme-primary) !important;
  color: var(--theme-bg) !important;
  border-color: var(--theme-primary) !important;
  font-weight: 800 !important;
}

:root[data-theme="dark"] .vk-cta-btn:hover,
html[data-a11y-on][data-a11y-scheme="dark"] .vk-cta-btn:hover {
  background: color-mix(in srgb, var(--theme-primary) 88%, #ffffff) !important;
  color: var(--theme-bg) !important;
}

/* Новости: убираем светлые подложки QR/картинок/кнопок при тёмной теме */
:root[data-theme="dark"] .hero-vk-qr img,
:root[data-theme="dark"] #vk-news-cards .vk-post img,
:root[data-theme="dark"] #vk-news-cards .card img {
  background: var(--theme-surface-soft) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] #vk-top-news h2,
:root[data-theme="dark"] #vk-news-cards .vk-post h3,
:root[data-theme="dark"] #vk-news-cards .card h3,
:root[data-theme="dark"] .hero-points {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .vk-news-layout {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--theme-primary-soft) 45%, var(--theme-surface)),
    var(--theme-surface)
  ) !important;
}

/* Обратная связь: согласие на обработку ПД (читаемость в светлой и тёмной теме) */
.feedback-form .feedback-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--theme-border, #d4deef) 90%, var(--theme-primary, #1f57c3) 10%);
  background: color-mix(in srgb, var(--theme-surface, #fff) 93%, var(--theme-primary-soft, #e9f0ff));
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  color: var(--theme-text, #18243d);
}

.feedback-form .feedback-consent span {
  color: inherit;
}

.feedback-form .feedback-consent input[type="checkbox"] {
  margin-top: 0.32rem;
  flex-shrink: 0;
  width: 1.12rem;
  height: 1.12rem;
  accent-color: var(--theme-primary, #1f57c3);
}

.feedback-form .feedback-consent a {
  color: var(--theme-primary, #1f57c3) !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

:root[data-theme="dark"] .feedback-form .feedback-consent,
:root[data-theme="dark"] .feedback-form .feedback-consent span {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .feedback-form .feedback-consent {
  background: color-mix(in srgb, var(--theme-surface) 88%, var(--theme-primary-soft)) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .feedback-form .feedback-consent a {
  color: var(--theme-primary) !important;
}

@media (max-width: 960px) {
  .feedback-form .feedback-consent {
    padding: 0.7rem 0.65rem;
    margin-top: 0.45rem;
  }
}

/* Главная: вторичная кнопка опроса (не перебивает .home-survey__btn--primary) */
:root[data-theme="dark"] .home-survey__btn:not(.home-survey__btn--primary) {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

/* Документы: затемнение подложки просмотрщика без жёсткого rgba в разметке */
body[data-cms-page="documents"] .doc-inline-viewer {
  background: color-mix(in srgb, var(--theme-text) 32%, transparent);
}

:root[data-theme="dark"] body[data-cms-page="documents"] .doc-inline-viewer {
  background: color-mix(in srgb, var(--theme-bg) 12%, black 88%) !important;
}

:root[data-theme="dark"] body[data-cms-page="documents"] .doc-inline-head p {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] body[data-cms-page="documents"] .docs-files-meta {
  color: var(--theme-text) !important;
}

/* Global dark readability hardening across all pages */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .contact-item,
:root[data-theme="dark"] .office-map-wrap,
:root[data-theme="dark"] .faq-block,
:root[data-theme="dark"] .faq-toc,
:root[data-theme="dark"] .ner-voi-card,
:root[data-theme="dark"] .service-card,
:root[data-theme="dark"] .hero-premium,
:root[data-theme="dark"] .social-link,
:root[data-theme="dark"] .map-actions a,
:root[data-theme="dark"] .feedback-form button {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] p,
:root[data-theme="dark"] li,
:root[data-theme="dark"] span,
:root[data-theme="dark"] label,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] .faq-block summary,
:root[data-theme="dark"] .ner-voi-card-title,
:root[data-theme="dark"] .contact-item h3 {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .feedback-form input,
:root[data-theme="dark"] .feedback-form textarea,
:root[data-theme="dark"] .docs-search-wrap input,
:root[data-theme="dark"] .topbar-search__input {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] .topbar-search__input::placeholder {
  color: var(--theme-muted) !important;
  opacity: 1;
}

/* FAQ hero: убираем «белую кляксу» в градиенте при тёмной теме */
:root[data-theme="dark"] .faq-page .hero-card {
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--theme-primary-soft) 55%, var(--theme-surface)) 0%,
    var(--theme-surface) 72%
  ) !important;
  border-color: var(--theme-border) !important;
}

/* Навигация «следующий раздел» и подобные pill-кнопки */
:root[data-theme="dark"] .premium-next-btn {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .premium-next-btn:hover {
  background: color-mix(in srgb, var(--theme-primary-soft) 42%, var(--theme-surface)) !important;
  border-color: color-mix(in srgb, var(--theme-primary) 35%, var(--theme-border)) !important;
}

/* Страница документов: подсказки в боковой колонке и кнопка «Очистить» поиска */
:root[data-theme="dark"] .doc-list-reset li {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] a {
  color: var(--theme-primary);
}

:root[data-theme="dark"] a:hover {
  color: color-mix(in srgb, var(--theme-primary) 72%, #ffffff);
}

/* После общего правила для ссылок: кнопки «Открыть»/«Скачать» остаются читабельными как кнопки */
:root[data-theme="dark"] .docs-search-wrap button {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .file-doc-actions a,
:root[data-theme="dark"] .file-doc-actions button {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

:root[data-theme="dark"] .topbar-mobile-drawer__link {
  color: var(--theme-text) !important;
}

:root[data-theme="dark"] .topbar-mobile-drawer__hint {
  color: var(--theme-muted) !important;
}

@media (max-width: 960px) {
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] {
    --theme-bg: #000000;
    --theme-surface: #000000;
    --theme-surface-soft: #070b12;
    --theme-text: #ffffff;
    --theme-muted: #f0f4ff;
    --theme-border: #ffffff;
    --theme-primary: #9fc0ff;
    --theme-primary-soft: #0f1d38;
    font-size: 118%;
  }

  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] p,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] li,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] a,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] button,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] label,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] input,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] textarea,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] select {
    color: #ffffff !important;
    border-color: #ffffff !important;
    line-height: 1.8 !important;
    font-weight: 700 !important;
  }

  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] .card,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] .hero-card,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] .faq-block,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] .topbar,
  :root[data-a11y-dark-mobile-strong="on"][data-theme="dark"] .toolbar {
    background: #000000 !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
  }
}

/* Mobile dark hardening: единый слой против белых подложек/градиентов на всех страницах */
@media (max-width: 960px) {
  :root[data-theme="dark"] html,
  html[data-a11y-on][data-a11y-scheme="dark"],
  :root[data-theme="dark"] body,
  html[data-a11y-on][data-a11y-scheme="dark"] body {
    background: var(--theme-bg) !important;
    background-color: var(--theme-bg) !important;
  }

  :root[data-theme="dark"] body::before,
  html[data-a11y-on][data-a11y-scheme="dark"] body::before {
    opacity: 0.08;
  }

  :root[data-theme="dark"] .card,
  html[data-a11y-on][data-a11y-scheme="dark"] .card,
  :root[data-theme="dark"] .hero-card,
  html[data-a11y-on][data-a11y-scheme="dark"] .hero-card,
  :root[data-theme="dark"] .hero-premium,
  html[data-a11y-on][data-a11y-scheme="dark"] .hero-premium,
  :root[data-theme="dark"] .events-plan-wrap,
  html[data-a11y-on][data-a11y-scheme="dark"] .events-plan-wrap,
  :root[data-theme="dark"] .partners-wrap,
  html[data-a11y-on][data-a11y-scheme="dark"] .partners-wrap,
  :root[data-theme="dark"] .masterclass-card,
  html[data-a11y-on][data-a11y-scheme="dark"] .masterclass-card,
  :root[data-theme="dark"] .home-survey,
  html[data-a11y-on][data-a11y-scheme="dark"] .home-survey,
  :root[data-theme="dark"] .faq-block,
  html[data-a11y-on][data-a11y-scheme="dark"] .faq-block,
  :root[data-theme="dark"] .faq-toc,
  html[data-a11y-on][data-a11y-scheme="dark"] .faq-toc,
  :root[data-theme="dark"] .ner-voi-card,
  html[data-a11y-on][data-a11y-scheme="dark"] .ner-voi-card,
  :root[data-theme="dark"] .service-card,
  html[data-a11y-on][data-a11y-scheme="dark"] .service-card,
  :root[data-theme="dark"] .official-footer-card,
  html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-card,
  :root[data-theme="dark"] .qr-footer,
  html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer,
  :root[data-theme="dark"] .qr-footer__item,
  html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer__item,
  :root[data-theme="dark"] .brand-note,
  html[data-a11y-on][data-a11y-scheme="dark"] .brand-note,
  :root[data-theme="dark"] .vk-news-layout,
  html[data-a11y-on][data-a11y-scheme="dark"] .vk-news-layout,
  :root[data-theme="dark"] #vk-news-cards .vk-post,
  html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post,
  :root[data-theme="dark"] #vk-news-cards .card,
  html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .card,
  :root[data-theme="dark"] .doc-inline-dialog,
  html[data-a11y-on][data-a11y-scheme="dark"] .doc-inline-dialog,
  :root[data-theme="dark"] .docs-files-toolbar,
  html[data-a11y-on][data-a11y-scheme="dark"] .docs-files-toolbar,
  :root[data-theme="dark"] .docs-filter-empty,
  html[data-a11y-on][data-a11y-scheme="dark"] .docs-filter-empty {
    background: var(--theme-surface) !important;
    background-image: none !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
  }

  :root[data-theme="dark"] .official-footer-nav a,
  html[data-a11y-on][data-a11y-scheme="dark"] .official-footer-nav a,
  :root[data-theme="dark"] .footer-social-link,
  html[data-a11y-on][data-a11y-scheme="dark"] .footer-social-link,
  :root[data-theme="dark"] .doc-quick-nav a,
  html[data-a11y-on][data-a11y-scheme="dark"] .doc-quick-nav a,
  :root[data-theme="dark"] .about-quick-nav a,
  html[data-a11y-on][data-a11y-scheme="dark"] .about-quick-nav a,
  :root[data-theme="dark"] .file-doc-actions a,
  html[data-a11y-on][data-a11y-scheme="dark"] .file-doc-actions a,
  :root[data-theme="dark"] .file-doc-actions button,
  html[data-a11y-on][data-a11y-scheme="dark"] .file-doc-actions button,
  :root[data-theme="dark"] .hero-actions a,
  html[data-a11y-on][data-a11y-scheme="dark"] .hero-actions a {
    background: var(--theme-surface-soft) !important;
    background-image: none !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
  }

  :root[data-theme="dark"] #vk-news-cards .vk-post p:last-child a,
  html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .vk-post p:last-child a,
  :root[data-theme="dark"] #vk-news-cards .card p:last-child a,
  html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards .card p:last-child a,
  :root[data-theme="dark"] .vk-cta-btn,
  html[data-a11y-on][data-a11y-scheme="dark"] .vk-cta-btn {
    background: var(--theme-primary) !important;
    color: var(--theme-bg) !important;
    border-color: var(--theme-primary) !important;
  }

  :root[data-theme="dark"] .qr-footer img,
  html[data-a11y-on][data-a11y-scheme="dark"] .qr-footer img,
  :root[data-theme="dark"] .hero-vk-qr img,
  html[data-a11y-on][data-a11y-scheme="dark"] .hero-vk-qr img,
  :root[data-theme="dark"] #vk-news-cards img,
  html[data-a11y-on][data-a11y-scheme="dark"] #vk-news-cards img {
    background: var(--theme-surface-soft) !important;
    border-color: var(--theme-border) !important;
  }
}

/* Панель для слабовидящих: всегда светлая и читаемая, независимо от темы сайта */
#access-toolbar.toolbar--popover {
  --theme-surface: #ffffff;
  --theme-surface-soft: #f4f7fc;
  --theme-text: #18243d;
  --theme-muted: #5f6d8c;
  --theme-border: #c5d3ea;
  --theme-primary: #243b84;
  --theme-primary-soft: #e8efff;
  background: #ffffff !important;
  color: #18243d !important;
}

#access-toolbar.toolbar--popover .toolbar-header {
  background: #243b84 !important;
  color: #ffffff !important;
  border-bottom-color: #1b2f6a !important;
}

#access-toolbar.toolbar--popover .toolbar-header strong {
  color: #ffffff !important;
}

#access-toolbar.toolbar--popover .a11y-panel-close-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  color: #ffffff !important;
}

#access-toolbar.toolbar--popover .access-btn.a11y-choice.is-active,
#access-toolbar.toolbar--popover .a11y-scheme-btn.is-active,
#access-toolbar.toolbar--popover .a11y-btn--primary.is-on {
  background: #243b84 !important;
  border-color: #243b84 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

#access-toolbar.toolbar--popover .toolbar-body.a11y-scroll-pro {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  max-height: calc(min(88vh, 820px) - 58px) !important;
  padding: 0 !important;
}

#access-toolbar.toolbar--popover .toolbar-body.a11y-scroll-pro .a11y-scroll {
  flex: 1 1 auto;
  min-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 0.85rem 0.5rem;
  scrollbar-gutter: stable both-edges;
}

#access-toolbar.toolbar--popover .toolbar-body.a11y-scroll-pro .a11y-block-title {
  margin: 0.85rem 0 0.35rem;
  padding: 0.35rem 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--theme-primary, #243b84);
  border-top: 2px solid color-mix(in srgb, var(--theme-primary, #243b84) 22%, var(--theme-border, #c5d3ea));
}

#access-toolbar.toolbar--popover .toolbar-body.a11y-scroll-pro .a11y-block-title:first-child {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

#access-toolbar.toolbar--popover .toolbar-body.a11y-scroll-pro .a11y-reset-wrap {
  flex: 0 0 auto;
}

#access-toolbar.toolbar--popover .a11y-tabs--quad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.65rem 0.85rem 0.35rem;
  border-bottom: 1px solid var(--theme-border, #d4deef);
  background: var(--theme-surface-soft, #f4f7fc);
}

#access-toolbar.toolbar--popover .a11y-tab {
  min-height: 44px;
  padding: 0.35rem 0.4rem;
  border: 2px solid var(--theme-border, #d4deef);
  border-radius: 10px;
  background: var(--theme-surface, #fff);
  color: var(--theme-text, #18243d);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

#access-toolbar.toolbar--popover .a11y-tab.is-active {
  border-color: var(--theme-primary, #243b84);
  background: color-mix(in srgb, var(--theme-primary-soft, #e8efff) 75%, #fff);
  color: var(--theme-primary, #243b84);
}

#access-toolbar.toolbar--popover .a11y-panes {
  display: block;
}

#access-toolbar.toolbar--popover .a11y-pane {
  display: none !important;
}

#access-toolbar.toolbar--popover .a11y-pane.is-active {
  display: block !important;
}

#access-toolbar.toolbar--popover .a11y-pane[hidden] {
  display: none !important;
}

#access-toolbar.toolbar--popover .a11y-voice-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

#access-toolbar.toolbar--popover .a11y-voice-list__group-title {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--theme-primary, #243b84);
}

#access-toolbar.toolbar--popover .a11y-voice-list__row .a11y-voice-installed-btn {
  flex: 1 1 100%;
  text-align: left;
  justify-content: flex-start;
}

#access-toolbar.toolbar--popover .a11y-voice-hint--warn {
  color: #8a1f1f;
  font-weight: 700;
}

#access-toolbar.toolbar--popover .a11y-hotkeys__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
