/* PAWZA accessibility controls */
:root {
  --pawza-a11y-scale: 1;
  --pawza-a11y-inverse-scale: 1;
}

body {
  zoom: var(--pawza-a11y-scale);
}

.pawza-a11y-root {
  --a11y-primary: #6558d9;
  --a11y-primary-dark: #4f46b8;
  --a11y-ink: #27243a;
  --a11y-muted: #69657b;
  --a11y-surface: #ffffff;
  --a11y-soft: #f3f1fb;
  --a11y-border: #e1dff0;
  position: relative;
  z-index: 30000;
  direction: rtl;
  font-family: 'Segoe UI', system-ui, sans-serif;
  zoom: var(--pawza-a11y-inverse-scale);
}

.pawza-a11y-trigger {
  position: fixed;
  inset-inline-start: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(145deg, #7468ec, #5548c7);
  box-shadow: 0 10px 28px rgba(56, 47, 135, .34), 0 0 0 2px rgba(101, 88, 217, .28);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.pawza-a11y-trigger:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(56, 47, 135, .42); }
.pawza-a11y-trigger:focus-visible,
.pawza-a11y-panel button:focus-visible { outline: 3px solid #f5b942; outline-offset: 3px; }

.pawza-a11y-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(25, 22, 44, .3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.pawza-a11y-panel {
  position: fixed;
  inset-inline-start: 18px;
  bottom: 94px;
  width: min(390px, calc(100vw - 36px));
  max-height: min(690px, calc(100vh - 118px));
  overflow: auto;
  color: var(--a11y-ink);
  background: var(--a11y-surface);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(31, 27, 66, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transform-origin: bottom left;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.pawza-a11y-root.is-open .pawza-a11y-panel { opacity: 1; visibility: visible; transform: none; }
.pawza-a11y-root.is-open .pawza-a11y-backdrop { opacity: 1; pointer-events: auto; }

.pawza-a11y-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 20px;
  color: #fff;
  background: linear-gradient(115deg, #6558d9, #7b70ea);
}

.pawza-a11y-title { display: flex; align-items: center; gap: 10px; }
.pawza-a11y-title h2 { margin: 0; color: inherit; font-size: 21px; line-height: 1.2; }
.pawza-a11y-close { width: 38px; height: 38px; border: 0; border-radius: 12px; color: #fff; background: rgba(255,255,255,.14); cursor: pointer; font-size: 25px; }
.pawza-a11y-content { padding: 20px; }
.pawza-a11y-section + .pawza-a11y-section { margin-top: 22px; }
.pawza-a11y-section h3 { margin: 0 0 10px; color: var(--a11y-muted); font-size: 14px; font-weight: 750; }
.pawza-a11y-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }

.pawza-a11y-option,
.pawza-a11y-choice,
.pawza-a11y-reset {
  min-height: 48px;
  border: 1px solid var(--a11y-border);
  border-radius: 14px;
  color: var(--a11y-ink);
  background: var(--a11y-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.pawza-a11y-option { display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 11px 13px; text-align: right; }
.pawza-a11y-option:hover,
.pawza-a11y-choice:hover { transform: translateY(-1px); border-color: #b9b3e7; }
.pawza-a11y-option[aria-pressed="true"],
.pawza-a11y-choice[aria-pressed="true"] { color: #fff; border-color: var(--a11y-primary); background: var(--a11y-primary); }
.pawza-a11y-option svg { flex: 0 0 auto; }

.pawza-a11y-segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pawza-a11y-choice { padding: 10px 7px; min-width: 0; }
.pawza-a11y-reset { width: 100%; margin-top: 22px; color: #5548c7; background: #fff; border-style: dashed; }
.pawza-a11y-status { margin: 10px 0 0; min-height: 20px; color: var(--a11y-muted); font-size: 13px; text-align: center; }

html[data-a11y-contrast="high"] { filter: contrast(1.35); }
html[data-a11y-contrast="invert"] { filter: invert(1) hue-rotate(180deg); background: #000; }
html[data-a11y-contrast="invert"] img,
html[data-a11y-contrast="invert"] video { filter: invert(1) hue-rotate(180deg); }
html[data-a11y-grayscale="true"] { filter: grayscale(1); }
html[data-a11y-contrast="high"][data-a11y-grayscale="true"] { filter: contrast(1.35) grayscale(1); }
html[data-a11y-contrast="invert"][data-a11y-grayscale="true"] { filter: invert(1) hue-rotate(180deg) grayscale(1); }
html[data-a11y-links="true"] a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
html[data-a11y-readable="true"] body { font-family: Arial, sans-serif !important; letter-spacing: .025em; word-spacing: .08em; }
html[data-a11y-readable="true"] body *:not(.pawza-a11y-root):not(.pawza-a11y-root *) { font-family: Arial, sans-serif !important; }
html[data-a11y-motion="reduce"] *,
html[data-a11y-motion="reduce"] *::before,
html[data-a11y-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
html[data-a11y-motion="reduce"] body *:not(.pawza-a11y-root):not(.pawza-a11y-root *) {
  transform: var(--pawza-a11y-rest-transform) !important;
}
html[data-a11y-focus="true"] :focus,
html[data-a11y-focus="true"] :focus-visible {
  outline: 4px solid #ffb703 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #172554 !important;
}
html[data-a11y-cursor="true"], html[data-a11y-cursor="true"] * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewBox='0 0 40 48'%3E%3Cpath fill='white' stroke='black' stroke-width='2' d='M4 2v34l9-8 7 16 7-4-7-15h13z'/%3E%3C/svg%3E") 4 2, auto !important; }

@media (max-width: 520px) {
  .pawza-a11y-trigger { inset-inline-start: 14px; bottom: 14px; width: 54px; height: 54px; }
  .pawza-a11y-panel { inset-inline-start: 8px; bottom: 76px; width: calc(100vw - 16px); max-height: calc(100vh - 88px); border-radius: 22px; }
  .pawza-a11y-content { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pawza-a11y-root * { transition: none !important; }
}
