/* ===== КНОПКА ДЛЯ СЛАБОВИДЯЩИХ ===== */
#a11y-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  background: #ffffff;
  color: #0057B7;
  border: 2px solid #0057B7;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: all 0.2s;
}
#a11y-toggle:hover {
  background: #0057B7;
  color: #ffffff;
}
#a11y-toggle:focus {
  outline: 3px solid #0057B7;
  outline-offset: 3px;
}

/* ===== ПАНЕЛЬ НАСТРОЕК ===== */
#a11y-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 320px;
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  padding: 24px;
  box-sizing: border-box;
}
#a11y-panel.open {
  right: 0;
}
.a11y-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.a11y-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0;
}
.a11y-panel-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.a11y-panel-close:hover { background: #f0f0f0; }
.a11y-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin: 20px 0 12px;
}
.a11y-control {
  margin-bottom: 16px;
}
.a11y-control-label {
  font-size: 14px;
  color: #444;
  margin-bottom: 8px;
  display: block;
}
.a11y-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.a11y-btn {
  padding: 8px 14px;
  border: 2px solid #D0D5DD;
  border-radius: 20px;
  background: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: Arial, sans-serif;
}
.a11y-btn:hover {
  border-color: #0057B7;
  color: #0057B7;
}
.a11y-btn.active {
  background: #0057B7;
  border-color: #0057B7;
  color: #ffffff;
}
.a11y-btn:focus {
  outline: 3px solid #0057B7;
  outline-offset: 2px;
}
.a11y-reset {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  font-family: Arial, sans-serif;
}
.a11y-reset:hover { background: #e8e8e8; }
.a11y-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 99998;
}
.a11y-overlay.open { display: block; }

/* ===== РЕЖИМЫ — применяются ко всему сайту ===== */
body.a11y-font-medium .t-text,
body.a11y-font-medium .t-title,
body.a11y-font-medium p,
body.a11y-font-medium li,
body.a11y-font-medium span {
  font-size: 120% !important;
}
body.a11y-font-large .t-text,
body.a11y-font-large .t-title,
body.a11y-font-large p,
body.a11y-font-large li,
body.a11y-font-large span {
  font-size: 145% !important;
}
body.a11y-lh-medium * { line-height: 1.7 !important; }
body.a11y-lh-large * { line-height: 2.0 !important; }

body.a11y-dark {
  background: #121212 !important;
  filter: invert(1) hue-rotate(180deg);
}
body.a11y-dark img,
body.a11y-dark video {
  filter: invert(1) hue-rotate(180deg);
}

body.a11y-contrast .t-text,
body.a11y-contrast p,
body.a11y-contrast span,
body.a11y-contrast li {
  color: #000000 !important;
}
body.a11y-contrast a { color: #0044CC !important; text-decoration: underline !important; }

body.a11y-yellow {
  background: #000000 !important;
  filter: invert(0);
}
body.a11y-yellow .t-text,
body.a11y-yellow p,
body.a11y-yellow span,
body.a11y-yellow li,
body.a11y-yellow .t-title {
  color: #FFE500 !important;
}

body.a11y-no-images img { opacity: 0.05 !important; }

body.a11y-highlight-links a {
  text-decoration: underline !important;
  background: rgba(0,87,183,0.1) !important;
  padding: 1px 3px !important;
  border-radius: 2px !important;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 640px) {
  #a11y-panel {
      width: 100%;
    right: -100%;
  }
  #a11y-toggle span {
    display: none;
  }
}