.a11y-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1A1A2E;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.a11y-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.a11y-trigger:focus-visible {
  outline: 3px solid #F5B731;
  outline-offset: 3px;
}

.a11y-panel {
  position: fixed;
  bottom: 88px;
  left: 24px;
  z-index: 9998;
  width: 320px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  overflow: hidden;
  transform: translateY(16px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.25s;
}

.a11y-panel.a11y-panel-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #E5E7EB;
}

.a11y-panel-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1;
}

.a11y-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #F3F4F6;
  color: #6B7280;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  line-height: 1;
}

.a11y-close:hover {
  background: #E5E7EB;
  color: #111827;
}

.a11y-panel-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  -webkit-overflow-scrolling: touch;
}

.a11y-group {
  margin-bottom: 16px;
}

.a11y-group:last-of-type {
  margin-bottom: 20px;
}

.a11y-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.a11y-font-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.a11y-font-btn {
  width: 44px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #374151;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.a11y-font-btn:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}

.a11y-font-value {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  min-width: 48px;
  text-align: center;
}

.a11y-contrast-controls {
  display: flex;
  gap: 8px;
}

.a11y-contrast-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: #374151;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.a11y-contrast-btn:hover {
  background: #F3F4F6;
}

.a11y-contrast-btn.active {
  background: #1A1A2E;
  color: #fff;
  border-color: #1A1A2E;
}

.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
}

.a11y-toggle-row span:first-child {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

.a11y-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.a11y-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #D1D5DB;
  border-radius: 12px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.a11y-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.a11y-checkbox:checked + .a11y-switch {
  background: #F5B731;
}

.a11y-checkbox:checked + .a11y-switch::after {
  transform: translateX(20px);
}

.a11y-checkbox:focus-visible + .a11y-switch {
  outline: 3px solid #F5B731;
  outline-offset: 2px;
}

.a11y-reset {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  background: #F9FAFB;
  color: #6B7280;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.a11y-reset:hover {
  background: #F3F4F6;
  color: #374151;
  border-color: #9CA3AF;
}

html.a11y-high-contrast {
  filter: contrast(1.4);
}

html.a11y-dark-mode {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-dark-mode img,
html.a11y-dark-mode video,
html.a11y-dark-mode canvas,
html.a11y-dark-mode svg,
html.a11y-dark-mode .hero,
html.a11y-dark-mode .donate-hero {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-highlight-links a {
  outline: 2px solid #F5B731 !important;
  outline-offset: 2px;
  text-decoration: underline !important;
}

html.a11y-highlight-links a:focus {
  outline: 3px solid #F5B731 !important;
}

html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

html.a11y-big-cursor,
html.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M4 4l20 8-8 4-4 8z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 4 4, auto !important;
}

html.a11y-big-cursor a,
html.a11y-big-cursor button,
html.a11y-big-cursor [role="button"],
html.a11y-big-cursor input[type="submit"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M10 4v20l4-4h8z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 10 4, pointer !important;
}

html.a11y-dyslexia-font body,
html.a11y-dyslexia-font p,
html.a11y-dyslexia-font li,
html.a11y-dyslexia-font span,
html.a11y-dyslexia-font a,
html.a11y-dyslexia-font td,
html.a11y-dyslexia-font th,
html.a11y-dyslexia-font input,
html.a11y-dyslexia-font textarea,
html.a11y-dyslexia-font select,
html.a11y-dyslexia-font label {
  font-family: 'Comic Sans MS', 'OpenDyslexic', Arial, sans-serif !important;
  letter-spacing: 0.05em;
}

html.a11y-text-spacing body {
  line-height: 2 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

html.a11y-text-spacing p,
html.a11y-text-spacing li,
html.a11y-text-spacing span {
  line-height: 2 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

@media (max-width: 480px) {
  .a11y-trigger {
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
  }

  .a11y-panel {
    bottom: 72px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 100px);
  }
}
