.accessibility-widget {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 9999;
  direction: rtl;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.accessibility-toggle {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: linear-gradient(145deg, #3e5c4a, #263f31);
  color: #ffffff;
  box-shadow: 0 20px 48px rgba(38, 63, 49, .28);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.accessibility-toggle:hover,
.accessibility-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 58px rgba(38, 63, 49, .34);
}

.accessibility-toggle:focus-visible,
.accessibility-panel :where(button, a):focus-visible {
  outline: 3px solid #c97f3d;
  outline-offset: 3px;
}

.accessibility-toggle svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
}

.accessibility-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(18, 23, 19, .2);
  opacity: 0;
  transition: opacity .22s ease;
}

.accessibility-widget.is-open .accessibility-backdrop {
  opacity: 1;
}

.accessibility-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(430px, calc(100vw - 18px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-right: 1px solid rgba(62, 92, 74, .15);
  border-radius: 0 28px 28px 0;
  background: #ffffff;
  box-shadow: 24px 0 80px rgba(24, 38, 29, .24);
  color: #2b2b2b;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-104%);
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

.accessibility-widget.is-open .accessibility-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.accessibility-panel-header {
  min-height: 142px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 18px;
  padding: 24px 26px 30px;
  background: linear-gradient(135deg, #263f31, #3e5c4a);
  color: #ffffff;
}

.accessibility-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #ffffff;
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
}

.accessibility-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: #f3c476;
  font-size: 14px;
  font-weight: 800;
}

.accessibility-panel h2 {
  margin: 0;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.15;
}

.accessibility-panel-body {
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 18% 0%, rgba(201, 127, 61, .08), transparent 34%),
    #f8f6f1;
}

.accessibility-group {
  border: 1px solid rgba(62, 92, 74, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 32px rgba(38, 63, 49, .08);
}

.accessibility-group + .accessibility-group {
  margin-top: 14px;
}

.accessibility-group-toggle {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: #263f31;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: right;
  cursor: pointer;
}

.accessibility-group-icon,
.accessibility-control-icon {
  display: grid;
  place-items: center;
  color: #263f31;
  font-weight: 900;
}

.accessibility-group-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(201, 127, 61, .13);
  color: #c97f3d;
  font-size: 20px;
}

.accessibility-group-chevron {
  color: #c97f3d;
  font-size: 22px;
  transition: transform .2s ease;
}

.accessibility-group-toggle[aria-expanded="true"] .accessibility-group-chevron {
  transform: rotate(180deg);
}

.accessibility-group-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 16px;
}

.accessibility-option,
.accessibility-stepper {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid rgba(62, 92, 74, .14);
  border-radius: 18px;
  background: #ffffff;
  color: #2b2b2b;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.accessibility-option:hover,
.accessibility-stepper:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 127, 61, .42);
  box-shadow: 0 12px 26px rgba(38, 63, 49, .1);
}

.accessibility-option[aria-pressed="true"] {
  border-color: rgba(38, 63, 49, .55);
  background: #263f31;
  color: #ffffff;
}

.accessibility-option[aria-pressed="true"] .accessibility-control-icon {
  color: #f3c476;
}

.accessibility-control-icon {
  min-height: 34px;
  font-size: 31px;
  line-height: 1;
}

.accessibility-control-label {
  font-weight: 900;
}

.accessibility-stepper {
  grid-column: 1 / -1;
  min-height: 128px;
}

.accessibility-stepper-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.accessibility-stepper-actions button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #263f31;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
}

.accessibility-stepper-actions output {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 999px;
  background: #f8f6f1;
  color: #263f31;
  font-weight: 900;
}

.accessibility-panel-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 22px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(62, 92, 74, .12);
  background: #ffffff;
}

.accessibility-reset {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #263f31;
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.accessibility-panel-footer a {
  color: #c97f3d;
  font-weight: 900;
  text-decoration: none;
}

html[data-accessibility-text="1"] body :where(p, li, a, button, input, textarea, select, label, span, h1, h2, h3, h4, h5, h6) {
  font-size: calc(1em * 1.1) !important;
}

html[data-accessibility-text="2"] body :where(p, li, a, button, input, textarea, select, label, span, h1, h2, h3, h4, h5, h6) {
  font-size: calc(1em * 1.2) !important;
}

html[data-accessibility-text="-1"] body :where(p, li, a, button, input, textarea, select, label, span, h1, h2, h3, h4, h5, h6) {
  font-size: calc(1em * .94) !important;
}

html.accessibility-line-spacing body :where(p, li, blockquote, dd, dt, a, button, input, textarea, select, label, span) {
  line-height: 1.9 !important;
}

html.accessibility-letter-spacing body,
html.accessibility-letter-spacing body * {
  letter-spacing: .08em !important;
}

html.accessibility-readable-font body,
html.accessibility-readable-font body * {
  font-family: Arial, Helvetica, sans-serif !important;
}

html.accessibility-highlight-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 3px !important;
  text-underline-offset: .24em !important;
}

html.accessibility-highlight-headings body :where(h1, h2, h3, h4, h5, h6) {
  outline: 2px solid rgba(201, 127, 61, .65) !important;
  outline-offset: .12em !important;
}

html.accessibility-pause-animations *,
html.accessibility-pause-animations *::before,
html.accessibility-pause-animations *::after {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}

html.accessibility-grayscale body {
  filter: grayscale(1) !important;
}

html.accessibility-high-contrast body {
  background: #ffffff !important;
  color: #000000 !important;
}

html.accessibility-high-contrast body :where(p, li, span, h1, h2, h3, h4, h5, h6, label, strong) {
  color: #000000 !important;
}

html.accessibility-high-contrast body :where(a, button) {
  color: #000000 !important;
}

html.accessibility-high-contrast body :where(.card, .policy-card, .term-card, .accessibility-card, .workshop-card, .contact-panel, .team-panel, .partners-carousel, .accessibility-panel, .accessibility-group, .accessibility-option, .accessibility-stepper) {
  border-color: #000000 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

html.accessibility-high-contrast .accessibility-toggle,
html.accessibility-high-contrast .accessibility-reset,
html.accessibility-high-contrast .accessibility-stepper-actions button,
html.accessibility-high-contrast .accessibility-option[aria-pressed="true"] {
  background: #000000 !important;
  color: #ffffff !important;
}

html.accessibility-dark-mode body {
  background: #171b18 !important;
  color: #f8f6f1 !important;
}

html.accessibility-dark-mode body :where(.section, .soft-band, .card, .policy-card, .term-card, .accessibility-card, .workshop-card, .contact-panel, .team-panel, .partners-carousel, .accessibility-panel, .accessibility-group, .accessibility-option, .accessibility-stepper, .accessibility-panel-footer) {
  background: #202820 !important;
  color: #f8f6f1 !important;
  border-color: rgba(248, 246, 241, .22) !important;
}

html.accessibility-dark-mode body :where(p, li, span, h1, h2, h3, h4, h5, h6, label, strong, a) {
  color: #f8f6f1 !important;
}

html.accessibility-dark-mode .accessibility-panel-body {
  background: #171b18 !important;
}

html.accessibility-dark-mode .accessibility-control-icon,
html.accessibility-dark-mode .accessibility-group-icon {
  color: #f3c476 !important;
}

@media (max-width: 640px) {
  .accessibility-widget {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .accessibility-toggle {
    width: 52px;
    height: 52px;
  }

  .accessibility-toggle svg {
    width: 28px;
    height: 28px;
  }

  .accessibility-panel {
    width: min(92vw, 390px);
    border-radius: 0 24px 24px 0;
  }

  .accessibility-panel-header {
    min-height: 124px;
    padding: 20px 20px 26px;
  }

  .accessibility-panel h2 {
    font-size: 30px;
  }

  .accessibility-panel-body {
    padding: 16px;
  }

  .accessibility-group-panel {
    gap: 10px;
    padding-inline: 12px;
  }

  .accessibility-option,
  .accessibility-stepper {
    min-height: 104px;
    font-size: 14px;
  }

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