.a11y-header-control {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.a11y-trigger,
.a11y-panel button {
  font-family: Arial, Helvetica, sans-serif;
}

.a11y-trigger {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(255, 190, 90, .5);
  border-radius: 7px;
  background: #111;
  color: #f5c66f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .18s, background-color .18s, color .18s;
}

.a11y-trigger:hover,
.a11y-trigger[aria-expanded="true"] {
  border-color: #f3b64a;
  background: #21180b;
  color: #fff;
}

.verhpravka {
  gap: 6px;
}

.dokpravka {
  gap: 7px;
}

.dokpravka .verhyazik {
  display: flex;
  align-items: center;
  margin: 0;
}

.verhpravka .a11y-trigger {
  width: 38px;
  padding: 0;
}

.verhpravka .a11y-trigger__label {
  display: none;
}

.a11y-trigger__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.a11y-trigger__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.a11y-trigger:focus-visible,
.a11y-panel button:focus-visible {
  outline: 3px solid #ffdc73;
  outline-offset: 3px;
}

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

.a11y-panel {
  position: fixed;
  z-index: 11000;
  top: 82px;
  inset-inline-end: max(12px, calc((100vw - 1200px) / 2));
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(243, 182, 74, .62);
  border-radius: 14px;
  background: #0b0b0b;
  color: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .72), 0 0 28px rgba(216, 138, 24, .14);
  direction: inherit;
  text-align: start;
  scrollbar-width: thin;
  scrollbar-color: #d88a18 #171717;
}

.a11y-panel,
.a11y-panel * {
  box-sizing: border-box;
}

.a11y-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.a11y-panel__title {
  margin: 2px 0 0;
  color: #fff;
  font-size: 18px !important;
  font-weight: 900;
  line-height: 1.25;
}

.a11y-panel__close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  background: #1b1b1b;
  color: #fff;
  font-size: 25px !important;
  line-height: 1;
  cursor: pointer;
}

.a11y-panel__font {
  display: grid;
  grid-template-columns: 1fr 74px 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.a11y-panel__button,
.a11y-panel__toggle,
.a11y-panel__reset {
  min-height: 44px;
  border: 1px solid rgba(243, 182, 74, .38);
  border-radius: 9px;
  background: #171717;
  color: #fff;
  font-size: 14px !important;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.a11y-panel__button:disabled {
  border-color: rgba(255, 255, 255, .1);
  color: #777;
  cursor: not-allowed;
}

.a11y-panel__value {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: #050505;
  color: #f3b64a;
  font-size: 14px !important;
  font-weight: 900;
}

.a11y-panel__toggle,
.a11y-panel__reset {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  padding: 9px 12px;
  text-align: start;
}

.a11y-panel__toggle::after {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid #aaa;
  border-radius: 50%;
}

.a11y-panel__toggle[aria-pressed="true"] {
  border-color: #f3b64a;
  background: #34240c;
  color: #fff4ce;
}

.a11y-panel__toggle[aria-pressed="true"]::after {
  border-color: #ffda72;
  background: #f3a326;
  box-shadow: 0 0 0 3px rgba(243, 163, 38, .2);
}

.a11y-panel__reset {
  justify-content: center;
  margin-top: 14px;
  background: #241706;
  color: #ffd27f;
}

html[data-a11y-font="120"] body { font-size: 19.2px !important; }
html[data-a11y-font="140"] body { font-size: 22.4px !important; }
html[data-a11y-font="160"] body { font-size: 25.6px !important; }

html[data-a11y-font]:not([data-a11y-font="100"]) body :where(p, li, a, span, b, strong, em, button, input, textarea, select, label, figcaption, dt, dd, th, td):not(.a11y-panel, .a11y-panel *, .a11y-trigger, .a11y-trigger *) {
  font-size: inherit !important;
}

html[data-a11y-font]:not([data-a11y-font="100"]) body :where(h1, h2, h3, h4, h5, h6):not(.a11y-panel, .a11y-panel *) {
  line-height: 1.2 !important;
}

html[data-a11y-font]:not([data-a11y-font="100"]) body h1:not(.a11y-panel *) { font-size: 2.5em !important; }
html[data-a11y-font]:not([data-a11y-font="100"]) body h1.glavnaslova { font-size: 3em !important; }
html[data-a11y-font]:not([data-a11y-font="100"]) body h2:not(.a11y-panel *) { font-size: 1.6em !important; }
html[data-a11y-font]:not([data-a11y-font="100"]) body h3:not(.a11y-panel *) { font-size: 1.3em !important; }
html[data-a11y-font]:not([data-a11y-font="100"]) body h4:not(.a11y-panel *) { font-size: 1.15em !important; }

html[data-a11y-font]:not([data-a11y-font="100"]) .golovasite {
  min-height: 70px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

html[data-a11y-font]:not([data-a11y-font="100"]) .verhnav ul {
  flex-wrap: wrap !important;
  row-gap: 8px !important;
}

html[data-a11y-font]:not([data-a11y-font="100"]) :where(.knopkareg, .knopkavhod) {
  height: auto !important;
  min-height: 2.5em !important;
  padding-top: .45em !important;
  padding-bottom: .45em !important;
}

html[data-a11y-contrast="high"] body,
html[data-a11y-contrast="high"] header,
html[data-a11y-contrast="high"] main,
html[data-a11y-contrast="high"] footer,
html[data-a11y-contrast="high"] section,
html[data-a11y-contrast="high"] article {
  background: #000 !important;
  color: #fff !important;
}

html[data-a11y-contrast="high"] body :where(h1, h2, h3, h4, h5, h6, p, li, span, b, strong, em, small, figcaption, dt, dd, th, td):not(.a11y-panel, .a11y-panel *) {
  color: #fff !important;
  text-shadow: none !important;
}

html[data-a11y-contrast="high"] body a:not(.a11y-trigger, .a11y-panel a) {
  color: #ffdf63 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}

html[data-a11y-contrast="high"] body :where(button, input, textarea, select):not(.a11y-panel *) {
  border-color: #fff !important;
  background: #000 !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-a11y-contrast="high"] body :where(.zvezdopad, .zolotoyorb, .bokehorb) {
  display: none !important;
}

html[data-a11y-contrast="high"] body *:focus-visible {
  outline: 3px solid #00e5ff !important;
  outline-offset: 3px !important;
}

html[data-a11y-spacing="large"] body :where(p, li, a, span, b, strong, em, button, input, textarea, label, figcaption, dt, dd, th, td):not(.a11y-panel, .a11y-panel *, .a11y-trigger, .a11y-trigger *) {
  letter-spacing: .045em !important;
  word-spacing: .1em !important;
}

html[data-a11y-spacing="large"] body :where(p, li, dt, dd, td, figcaption):not(.a11y-panel, .a11y-panel *) {
  line-height: 1.75 !important;
}

@media (max-width: 1199px) {
  .a11y-trigger__label { display: none; }
  .a11y-trigger { width: 38px; padding: 0; }
}

@media (max-width: 575px) {
  .golovasite > .logostorona {
    max-width: calc(100% - 126px) !important;
  }

  .golovasite > .verhpravka {
    width: 118px !important;
    max-width: 118px !important;
    flex-basis: 118px !important;
    gap: 7px !important;
  }

  .doklogostorona {
    max-width: 100% !important;
    flex-basis: 100% !important;
    justify-content: center !important;
  }

  .dokpravka {
    max-width: 100% !important;
    flex-basis: 100% !important;
    justify-content: center !important;
    padding: 0 6px 8px !important;
    gap: 7px;
  }

  .dokverhpolosa .dokgolova {
    flex-wrap: wrap !important;
  }

  .dokpravka .verhyazik,
  .dokpravka .verhyazik select {
    width: 66px !important;
    min-width: 66px !important;
    height: 38px !important;
    margin: 0 !important;
  }

  .dokpravka .knopkanaglav {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    max-width: 160px !important;
    padding-right: 9px !important;
    padding-left: 9px !important;
  }

  .a11y-panel {
    top: 12px;
    inset-inline: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
    padding: 15px;
  }
}

html[dir="rtl"] .a11y-panel,
html[dir="rtl"] .a11y-panel__toggle {
  direction: rtl;
  text-align: start;
}

@media (prefers-reduced-motion: reduce) {
  .a11y-trigger { transition: none; }
}
