:root {
  --text-scale: 1;
}

html {
  font-size: calc(16px * var(--text-scale));
  transition: font-size 0.3s ease;
}

body {
  font-size: 1rem;
}

.focus-highlight-enabled *:focus-visible {
  outline: 3px solid #000 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.1) !important;
}

.focus-highlight-enabled button:focus-visible,
.focus-highlight-enabled [role="button"]:focus-visible,
.focus-highlight-enabled a:focus-visible,
.focus-highlight-enabled input:focus-visible,
.focus-highlight-enabled textarea:focus-visible,
.focus-highlight-enabled select:focus-visible {
  outline: 3px solid #000 !important;
  outline-offset: 3px !important;
}

.high-contrast {
  filter: contrast(1.3);
}

.high-contrast button,
.high-contrast a,
.high-contrast input,
.high-contrast select,
.high-contrast textarea {
  border-width: 2px !important;
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

.alefos-a11y-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 2147483000;
  pointer-events: auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #050505;
}

.alefos-a11y-panel {
  position: absolute;
  right: 0;
  bottom: 4.75rem;
  width: min(20rem, calc(100vw - 32px));
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px);
  overflow: hidden;
  transform-origin: bottom right;
  animation: alefosA11ySlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alefos-a11y-panel[hidden] {
  display: none;
}

.alefos-a11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.alefos-a11y-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.alefos-a11y-title-icon,
.alefos-a11y-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}

.alefos-a11y-title-icon {
  width: 32px;
  height: 32px;
}

.alefos-a11y-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
}

.alefos-a11y-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.alefos-a11y-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.alefos-a11y-options {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.alefos-a11y-option {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.05);
  color: #050505;
  text-align: left;
  cursor: pointer;
}

.alefos-a11y-option:hover {
  background: rgba(0, 0, 0, 0.1);
}

.alefos-a11y-option[data-active="true"] {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.alefos-a11y-option[data-tone="purple"][data-active="true"] {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.alefos-a11y-option[data-tone="blue"][data-active="true"] {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.alefos-a11y-option-main {
  flex: 1 1 auto;
  min-width: 0;
}

.alefos-a11y-option-label {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.alefos-a11y-option-help {
  display: block;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.35;
}

.alefos-a11y-check {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
  flex: 0 0 auto;
}

.alefos-a11y-option[data-active="true"] .alefos-a11y-check {
  background: #4f46e5;
  position: relative;
}

.alefos-a11y-option[data-tone="purple"][data-active="true"] .alefos-a11y-check {
  background: #9333ea;
}

.alefos-a11y-option[data-tone="blue"][data-active="true"] .alefos-a11y-check {
  background: #2563eb;
}

.alefos-a11y-option[data-active="true"] .alefos-a11y-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.alefos-a11y-text {
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.05);
}

.alefos-a11y-text-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.alefos-a11y-text-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.alefos-a11y-text-copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.alefos-a11y-text-copy span {
  display: block;
  margin-top: 4px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.35;
}

.alefos-a11y-range {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  background: #e5e5e5;
  cursor: pointer;
}

.alefos-a11y-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #050505;
}

.alefos-a11y-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #050505;
}

.alefos-a11y-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
  color: rgba(0, 0, 0, 0.4);
  font-size: 12px;
}

.alefos-a11y-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.alefos-a11y-trigger {
  position: relative;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #0b0b0b;
  color: #fff;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.alefos-a11y-trigger:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.alefos-a11y-trigger:active {
  transform: scale(0.96);
}

.alefos-a11y-widget svg {
  width: 22px;
  height: 22px;
}

.alefos-a11y-trigger svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.85;
  pointer-events: none;
}

.alefos-a11y-close svg,
.alefos-a11y-title-icon svg,
.alefos-a11y-option-icon svg {
  pointer-events: none;
}

@keyframes alefosA11ySlideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .alefos-a11y-widget {
    right: 1.5rem;
    bottom: 1.5rem;
  }

  .alefos-a11y-panel {
    right: 0;
    bottom: 4.75rem;
  }
}
