/* Inklusions-Einstellungen – Toolbar in px (skaliert nicht mit), Inhalt über zoom */

html {
  --fluce-a11y-zoom: 1;
  --fluce-a11y-toolbar-zoom: 1;
}

html[data-a11y-text="large"] {
  --fluce-a11y-zoom: 1.08;
  --fluce-a11y-toolbar-zoom: 0.926; /* 1 / 1.08 */
}

html[data-a11y-text="xlarge"] {
  --fluce-a11y-zoom: 1.15;
  --fluce-a11y-toolbar-zoom: 0.870; /* 1 / 1.15 */
}

body {
  zoom: var(--fluce-a11y-zoom);
}

@supports not (zoom: 1) {
  html[data-a11y-text="large"] { font-size: 17px; }
  html[data-a11y-text="xlarge"] { font-size: 18px; }
  body { zoom: unset; }
}

/* Toolbar: feste px-Größen, gegen Body-Zoom ausgeglichen */
.a11y-toolbar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 8px;
  zoom: var(--fluce-a11y-toolbar-zoom);
  font-size: 14px;
  line-height: 1.4;
}

.a11y-toolbar-panel {
  display: none;
  width: 288px;
  max-width: calc(100vw - 32px);
  max-height: min(320px, 70vh);
  overflow-y: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(10, 15, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.a11y-toolbar-panel.open {
  display: block;
}

.a11y-toolbar-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.92);
}

.a11y-toolbar label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.a11y-toolbar select,
.a11y-toolbar button.a11y-toggle {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  text-align: left;
  cursor: pointer;
  appearance: auto;
}

.a11y-toolbar select option {
  background: #141b2d;
  color: #fff;
}

.a11y-toolbar button.a11y-toggle[aria-pressed="true"] {
  background: rgba(51, 163, 255, 0.22);
  border-color: rgba(51, 163, 255, 0.5);
  color: #8ed8ff;
}

.a11y-toolbar-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9999px;
  background: rgba(10, 15, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
}

.a11y-toolbar-trigger:hover {
  border-color: rgba(51, 163, 255, 0.45);
  color: #fff;
}

.a11y-toolbar-trigger svg {
  flex-shrink: 0;
}

/* Hoher Kontrast */
html[data-a11y-contrast="true"] body {
  color: #fff;
}

html[data-a11y-contrast="true"] [class*="text-white/"] {
  color: rgba(255, 255, 255, 0.92) !important;
}

html[data-a11y-contrast="true"] .glass,
html[data-a11y-contrast="true"] .input-field,
html[data-a11y-contrast="true"] .output-box,
html[data-a11y-contrast="true"] .a11y-toolbar-panel {
  border-color: rgba(255, 255, 255, 0.38) !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

html[data-a11y-contrast="true"] .btn-ghost {
  border-color: rgba(255, 255, 255, 0.38) !important;
  color: #fff !important;
}

html[data-a11y-contrast="true"] :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Animationen */
html[data-a11y-reduce-motion="true"] *,
html[data-a11y-reduce-motion="true"] *::before,
html[data-a11y-reduce-motion="true"] *::after {
  animation: none !important;
  transition: none !important;
}

#fluce-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .a11y-toolbar {
    bottom: 12px;
    left: 12px;
  }

  .a11y-toolbar-panel {
    width: min(288px, calc(100vw - 24px));
  }
}
