:root { --ops-a11y-text-scale: 1; }

.ops-a11y {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}
.ops-a11y *,
.ops-a11y *::before,
.ops-a11y *::after { box-sizing: border-box; }
.ops-a11y button { font-family: inherit; }

.ops-a11y__toggle {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 9000;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #14263d;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px #00000059;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ops-a11y__toggle:hover,
.ops-a11y__toggle:focus-visible {
  background: #21395a;
  transform: scale(1.05);
  outline: 3px solid #2eb5e0;
  outline-offset: 3px;
}
.ops-a11y__toggle svg { width: 28px; height: 28px; display: block; fill: currentColor; }

.ops-a11y__toolbar {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 134px;
  z-index: 9000;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 620px);
  overflow-y: auto;
  padding: 14px;
  border: 1px solid #21395a;
  border-radius: 10px;
  background: #14263d;
  color: #f5f7fa;
  box-shadow: 0 6px 28px #0006;
}
.ops-a11y__toolbar--open { display: block; animation: ops-a11y-panel-in 0.18s ease-out; }
@keyframes ops-a11y-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ops-a11y__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ops-a11y__title { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.ops-a11y__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

.ops-a11y__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid #35507a;
  border-radius: 7px;
  background: #1b3050;
  color: #f5f7fa;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.ops-a11y__btn:hover,
.ops-a11y__btn:focus-visible { background: #26456d; border-color: #ffd24a; }
.ops-a11y__btn[aria-pressed="true"] { background: #ffd24a; border-color: #fff; color: #14263d; }
.ops-a11y__btn--wide { grid-column: 1 / -1; }
.ops-a11y__state { margin-left: auto; font-size: 11px; font-weight: 700; opacity: 0.85; text-transform: uppercase; }

.ops-a11y__pace {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px 2px;
  font-size: 11.5px;
}
.ops-a11y__pace-btn {
  min-width: 44px;
  min-height: 32px;
  border: 1px solid #35507a;
  border-radius: 6px;
  background: #1b3050;
  color: #f5f7fa;
  font-weight: 700;
  cursor: pointer;
}
.ops-a11y__close {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid #35507a;
  border-radius: 6px;
  background: transparent;
  color: #f5f7fa;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.ops-a11y__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #21395a;
  font-size: 11.5px;
  color: #d6dee9;
}
.ops-a11y__brand a { color: #ffd24a; font-weight: 700; text-decoration: underline; }
.ops-a11y__hint { margin: 8px 0 0; font-size: 11px; color: #c3cedd; }

.ops-a11y__welcome {
  position: fixed;
  right: 16px;
  bottom: 134px;
  z-index: 8995;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border: 1px solid #21395a;
  border-radius: 10px;
  background: #14263d;
  color: #f5f7fa;
  font-size: 13px;
  box-shadow: 0 6px 28px #0006;
}
.ops-a11y__welcome[hidden],
.ops-a11y__toolbar[hidden] { display: none !important; }
.ops-a11y__welcome p { margin: 0 0 9px; line-height: 1.45; }
.ops-a11y__welcome-actions { display: flex; gap: 8px; }

.ops-a11y__scrim {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0, 0, 0, 0.55);
}
.ops-a11y__dialog {
  position: fixed;
  z-index: 9200;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 76vh;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid #21395a;
  border-radius: 10px;
  background: #14263d;
  color: #f5f7fa;
  box-shadow: 0 10px 40px #00000080;
}
.ops-a11y__dialog-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: #fff; }
.ops-a11y__dialog-section {
  margin: 12px 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd24a;
}
.ops-a11y__list { margin: 0; padding: 0; list-style: none; }
.ops-a11y__list li { margin: 0 0 4px; }
.ops-a11y__link-btn {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #35507a;
  border-radius: 6px;
  background: #1b3050;
  color: #f5f7fa;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.ops-a11y__level { display: inline-block; min-width: 26px; margin-right: 6px; font-size: 11px; font-weight: 700; color: #ffd24a; }
.ops-a11y__empty { margin: 0; font-size: 12.5px; color: #c3cedd; }

.ops-a11y__reading-line,
.ops-a11y__mask {
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 8990;
}
.ops-a11y__reading-line { height: 4px; background: #ff3b30; box-shadow: 0 0 0 1px #ffffffe6; }
.ops-a11y__mask { background: rgba(0, 0, 0, 0.68); }

html[data-a11y-text-scale="on"] #main p,
html[data-a11y-text-scale="on"] #main li,
html[data-a11y-text-scale="on"] #main td,
html[data-a11y-text-scale="on"] #main th {
  font-size: calc(1rem * var(--ops-a11y-text-scale)) !important;
}
html[data-a11y-text-scale="on"] #main h1 { font-size: calc(2.23rem * var(--ops-a11y-text-scale)) !important; }
html[data-a11y-text-scale="on"] #main h2 { font-size: calc(1.7rem * var(--ops-a11y-text-scale)) !important; }
html[data-a11y-text-scale="on"] #main h3 { font-size: calc(1.5rem * var(--ops-a11y-text-scale)) !important; }

html[data-a11y-text-spacing="on"] #main,
html[data-a11y-text-spacing="on"] #main * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}
html[data-a11y-line-spacing="on"] #main,
html[data-a11y-line-spacing="on"] #main * { line-height: 1.8 !important; }

html[data-a11y-hide-images="on"] #main img,
html[data-a11y-hide-images="on"] header img { visibility: hidden !important; }

html[data-a11y-stop-animations="on"] *,
html[data-a11y-stop-animations="on"] *::before,
html[data-a11y-stop-animations="on"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html[data-a11y-saturation="muted"] body > *:not(.ops-a11y) { filter: saturate(0.5); }
html[data-a11y-saturation="grayscale"] body > *:not(.ops-a11y) { filter: grayscale(1); }
html[data-a11y-saturation="vivid"] body > *:not(.ops-a11y) { filter: saturate(1.6); }

html[data-a11y-contrast="high"] body { background-color: #000 !important; color: #fff !important; }
html[data-a11y-contrast="high"] body > *:not(.ops-a11y),
html[data-a11y-contrast="high"] body > *:not(.ops-a11y) * {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html[data-a11y-contrast="high"] body > *:not(.ops-a11y) a { color: #ffd24a !important; text-decoration: underline !important; }

html[data-a11y-contrast="yellow"] body { background-color: #000 !important; color: #ff0 !important; }
html[data-a11y-contrast="yellow"] body > *:not(.ops-a11y),
html[data-a11y-contrast="yellow"] body > *:not(.ops-a11y) * {
  background-color: #000 !important;
  background-image: none !important;
  color: #ff0 !important;
  border-color: #ff0 !important;
}
html[data-a11y-contrast="yellow"] body > *:not(.ops-a11y) a { color: #fff !important; text-decoration: underline !important; }

html[data-a11y-highlight-links="on"] body > *:not(.ops-a11y) a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  background-color: #ff0 !important;
  color: #000 !important;
  outline: 2px solid #000 !important;
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .ops-a11y, .ops-a11y * { animation: none !important; transition: none !important; }
}
@media print {
  .ops-a11y { display: none !important; }
}
