/* CRyam Live — accessibility widget (IS 5568 / WCAG-oriented)
   Pattern: fixed corner launcher + fixed panel (like UserWay / EqualWeb / nagish) */

.a11y-root {
  position: fixed !important;
  inset: auto auto 1.1rem 0.85rem !important; /* bottom-left (physical LTR coords — stable on RTL pages) */
  z-index: 2147483646 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  font-family: "Heebo", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  direction: rtl;
  text-align: right;
  pointer-events: none; /* only children receive clicks */
  visibility: visible !important;
  opacity: 1 !important;
}

.a11y-toggle,
.a11y-panel {
  pointer-events: auto;
}

.a11y-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 3.5rem;
  height: 3.5rem;
  min-width: 3.5rem;
  min-height: 3.5rem;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: #0b5fff;
  font: inherit;
  font-size: 0;
  font-weight: 800;
  box-shadow:
    0 0 0 3px #ffd400,
    0 10px 28px rgba(0, 0, 0, 0.5);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.a11y-toggle:hover {
  background: #084dcc;
  box-shadow:
    0 0 0 3px #ffd400,
    0 14px 32px rgba(0, 0, 0, 0.55);
}

.a11y-toggle:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 3px;
}

.a11y-toggle[aria-expanded="true"] {
  background: #063fa8;
}

.a11y-toggle svg {
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  display: block;
}

/* Label shown only to screen readers / title tooltip */
.a11y-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Panel is FIXED to the viewport — never absolute to a moving root */
.a11y-panel {
  position: fixed !important;
  left: 0.85rem !important;
  right: auto !important;
  bottom: 5.1rem !important;
  top: auto !important;
  width: min(20.5rem, calc(100vw - 1.7rem));
  max-height: min(70vh, calc(100vh - 7rem));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.9rem 0.85rem 1rem;
  border-radius: 16px;
  background: #111018;
  color: #f4f2ff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  transform: none !important;
  z-index: 2147483646 !important;
}

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

.a11y-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.a11y-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.a11y-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.a11y-close:hover { background: rgba(255, 255, 255, 0.16); }
.a11y-close:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 2px;
}

.a11y-group {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.a11y-group-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c4bfd6;
  letter-spacing: 0.02em;
}

.a11y-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.a11y-btn {
  flex: 1 1 auto;
  min-width: 5.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f2ff;
  padding: 0.55rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.a11y-btn:hover { background: rgba(255, 255, 255, 0.12); }
.a11y-btn:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 2px;
}
.a11y-btn[aria-pressed="true"] {
  background: #1e4fb8;
  border-color: #6ea8ff;
  color: #fff;
}
.a11y-btn-reset {
  width: 100%;
  background: rgba(255, 77, 154, 0.15);
  border-color: rgba(255, 77, 154, 0.45);
}
.a11y-btn-reset:hover {
  background: rgba(255, 77, 154, 0.28);
}

.a11y-footer {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}
.a11y-footer a {
  color: #c9b8ff;
  font-weight: 700;
  text-underline-offset: 3px;
}
.a11y-footer a:hover { color: #fff; }
.a11y-footer a:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 2px;
}

/* —— Applied preference classes on <html> —— */
html.a11y-font-lg { font-size: 112.5%; }
html.a11y-font-xl { font-size: 125%; }
html.a11y-font-xxl { font-size: 137.5%; }

html.a11y-contrast,
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast a { color: #ffff00 !important; }
html.a11y-contrast .glass,
html.a11y-contrast .card,
html.a11y-contrast .wait-card,
html.a11y-contrast .info-card,
html.a11y-contrast .faq-item,
html.a11y-contrast .step,
html.a11y-contrast .cta-card,
html.a11y-contrast .seo-block,
html.a11y-contrast .a11y-panel {
  background: #000 !important;
  border-color: #fff !important;
  color: #fff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html.a11y-contrast .bg { display: none !important; }
html.a11y-contrast .muted,
html.a11y-contrast .section-sub,
html.a11y-contrast .lead,
html.a11y-contrast p,
html.a11y-contrast li {
  color: #fff !important;
}
html.a11y-contrast .btn-primary,
html.a11y-contrast .a11y-toggle {
  background: #ffff00 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}
html.a11y-contrast input,
html.a11y-contrast .pill {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

/* Never filter body/html — that breaks position:fixed */
html.a11y-grayscale .bg,
html.a11y-grayscale .top,
html.a11y-grayscale main,
html.a11y-grayscale footer,
html.a11y-grayscale .site-footer {
  filter: grayscale(1);
}
html.a11y-grayscale .a11y-root {
  filter: none !important;
}

html.a11y-underline a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}

html.a11y-readable,
html.a11y-readable body {
  font-family: Arial, "Helvetica Neue", Helvetica, "Open Sans", sans-serif !important;
  letter-spacing: 0.02em;
  word-spacing: 0.04em;
  line-height: 1.75 !important;
}
html.a11y-readable h1,
html.a11y-readable h2,
html.a11y-readable h3,
html.a11y-readable .brand-name,
html.a11y-readable .btn {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

html.a11y-stop-anim *,
html.a11y-stop-anim *::before,
html.a11y-stop-anim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.a11y-stop-anim {
  scroll-behavior: auto !important;
}

html.a11y-focus-strong a:focus,
html.a11y-focus-strong button:focus,
html.a11y-focus-strong input:focus,
html.a11y-focus-strong select:focus,
html.a11y-focus-strong textarea:focus,
html.a11y-focus-strong [tabindex]:focus,
html.a11y-focus-strong a:focus-visible,
html.a11y-focus-strong button:focus-visible,
html.a11y-focus-strong input:focus-visible {
  outline: 4px solid #ffd400 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px #000 !important;
}

/* Safe area on notched phones */
@supports (padding: max(0px)) {
  .a11y-root {
    inset: auto auto max(1.1rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left)) !important;
  }
  .a11y-panel {
    left: max(0.85rem, env(safe-area-inset-left)) !important;
    bottom: calc(5.1rem + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 480px) {
  .a11y-toggle {
    width: 3.25rem;
    height: 3.25rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
  }
}

/* LTR pages (multilingual) */
.a11y-root[dir="ltr"] { direction: ltr; text-align: left; }
