/* Refined premium accessibility panel: deep shell + clear light controls. */

.a11yEyeBtn {
  min-height: 34px;
  padding: 6px 16px 6px 10px;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .08)) !important;
  border: 1px solid rgba(255, 255, 255, .38) !important;
  box-shadow:
    0 7px 19px rgba(5, 45, 65, .13),
    inset 0 1px 0 rgba(255, 255, 255, .26) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.18);
  backdrop-filter: blur(12px) saturate(1.18);
}

.a11yEyeBtn .a11yTriggerIcon {
  width: 24px;
  height: 24px;
  color: #fff !important;
  background: rgba(255, 255, 255, .12) !important;
  border-radius: 8px;
}

.a11yEyeBtn .a11yTriggerIcon svg {
  width: 17px;
  height: 17px;
}

.a11yEyeBtn:hover,
.a11yEyeBtn.is-active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, .29), rgba(255, 255, 255, .14)) !important;
  border-color: rgba(255, 255, 255, .58) !important;
  box-shadow:
    0 9px 23px rgba(5, 48, 69, .2),
    inset 0 1px 0 rgba(255, 255, 255, .32) !important;
}

.a11yEyeBtn:hover .a11yTriggerIcon,
.a11yEyeBtn.is-active .a11yTriggerIcon {
  color: #fff !important;
  background: rgba(255, 255, 255, .13) !important;
}

.a11yPanel {
  position: relative;
  color: #eaf6fb !important;
  background:
    radial-gradient(circle at 88% -35%, rgba(51, 190, 199, .2), transparent 38%),
    radial-gradient(circle at 8% 125%, rgba(229, 91, 9, .14), transparent 32%),
    linear-gradient(128deg, #082b46 0%, #0a405e 55%, #0a5871 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, .12) !important;
  border-bottom: 1px solid rgba(5, 39, 60, .7) !important;
  box-shadow:
    0 24px 58px rgba(3, 35, 55, .27),
    inset 0 1px 0 rgba(255, 255, 255, .07) !important;
}

.a11yPanel::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #e15a06, #f08c3c 31%, #4bc4c0 70%, #56b6d3);
}

.a11yPanel::after {
  position: absolute;
  right: -75px;
  bottom: -145px;
  width: 310px;
  height: 310px;
  content: "";
  pointer-events: none;
  border: 48px solid rgba(255, 255, 255, .035);
  border-radius: 50%;
}

.a11yPanelInner {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 48px));
  padding: 20px 0 16px;
}

.a11yPanelHeader {
  margin-bottom: 14px;
}

.a11yEyebrow {
  margin-bottom: 3px;
  color: #ffad70 !important;
  font-size: 9px !important;
  letter-spacing: .15em !important;
}

.a11yPanel h2 {
  color: #fff !important;
  font-size: clamp(22px, 1.8vw, 28px) !important;
  letter-spacing: -.035em !important;
}

.a11yCloseButton {
  width: 42px;
  height: 42px;
  color: #fff !important;
  font-size: 27px !important;
  background: rgba(255, 255, 255, .1) !important;
  border: 1px solid rgba(255, 255, 255, .17) !important;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}

.a11yCloseButton:hover {
  color: #fff !important;
  background: #df5b08 !important;
  border-color: #ef8b47 !important;
  transform: rotate(4deg);
}

.a11yControlsGrid {
  grid-template-columns: minmax(245px, .66fr) minmax(460px, 1.3fr) minmax(355px, .95fr);
  gap: 11px;
  align-items: stretch;
}

.a11yControlGroup {
  min-width: 0;
  padding: 12px;
  color: #17374d !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(246, 250, 252, .97)) !important;
  border: 1px solid rgba(255, 255, 255, .64) !important;
  border-radius: 16px;
  box-shadow:
    0 10px 26px rgba(1, 28, 45, .17),
    inset 0 1px 0 #fff !important;
}

.a11yControlGroup legend,
.a11yGroupLabel {
  color: #617b8d !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .055em !important;
}

.a11ySegmented,
.a11yThemeButtons,
.a11yQuickButtons {
  gap: 6px;
}

.a11ySegmented button,
.a11yThemeButtons button,
.a11yQuickButtons button,
.a11yFooterButton,
.a11yNormalButton {
  color: #315269 !important;
  background: #edf4f7 !important;
  border: 1px solid #d9e6eb !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95);
}

.a11ySegmented button,
.a11yThemeButtons button {
  min-height: 43px;
}

.a11ySegmented button:hover,
.a11yThemeButtons button:hover,
.a11yQuickButtons button:hover {
  color: #0d5d7b !important;
  background: #e1eff3 !important;
  border-color: #b8d6df !important;
  transform: translateY(-1px);
}

.a11ySegmented button.is-active,
.a11yThemeButtons button.is-active,
.a11yQuickButtons button.is-active {
  color: #fff !important;
  background:
    radial-gradient(circle at 90% -25%, rgba(89, 207, 207, .24), transparent 50%),
    linear-gradient(135deg, #0d3e5c, #0e728e) !important;
  border-color: #0b607e !important;
  box-shadow:
    0 8px 18px rgba(7, 73, 101, .23),
    inset 0 1px 0 rgba(255, 255, 255, .13) !important;
}

.a11yFontGroup .a11ySegmented button.is-active {
  position: relative;
}

.a11yFontGroup .a11ySegmented button.is-active::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 5px;
  height: 5px;
  content: "";
  background: #78e0dc;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(120, 224, 220, .16);
}

.a11yThemeButtons button {
  padding-inline: 7px;
}

.a11yThemeButtons button.is-active .a11yThemeSwatch {
  border-color: rgba(255, 255, 255, .75) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .13);
}

.a11yThemeSwatch {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(19, 58, 79, .13);
}

.a11yQuickButtons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.a11yQuickButtons button {
  min-height: 43px;
  padding: 6px 8px;
  font-size: 11px !important;
}

.a11yControlIcon {
  width: 29px;
  height: 29px;
  color: #0f7798 !important;
  background: #dff0f5 !important;
  border: 1px solid #cce4ea;
  border-radius: 9px;
}

.a11yQuickButtons button.is-active .a11yControlIcon {
  color: #fff !important;
  background: rgba(255, 255, 255, .13) !important;
  border-color: rgba(255, 255, 255, .18);
}

.a11yAdvanced {
  margin-top: 11px;
  padding: 10px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.a11yAdvancedGrid {
  gap: 9px;
}

.a11yAdvanced .a11yControlGroup {
  box-shadow: 0 8px 20px rgba(2, 28, 44, .13) !important;
}

.a11ySpeechSettings label {
  color: #315269 !important;
}

.a11ySpeechSettings output {
  color: #d4580d !important;
}

.a11ySpeechSettings input[type="range"] {
  accent-color: #0f7898;
}

.a11yPanelFooter {
  margin-top: 11px;
  padding-top: 11px;
  border-top-color: rgba(255, 255, 255, .12);
}

.a11yFooterButton {
  min-height: 41px;
  padding: 9px 14px;
  color: rgba(255, 255, 255, .88) !important;
  font-size: 11px !important;
  background: rgba(255, 255, 255, .075) !important;
  border-color: rgba(255, 255, 255, .14) !important;
}

.a11yFooterButton:hover,
.a11yFooterButton.is-active {
  color: #fff !important;
  background: rgba(255, 255, 255, .14) !important;
  border-color: rgba(255, 255, 255, .25) !important;
}

.a11yNormalButton {
  min-height: 42px;
  padding: 9px 18px;
  color: #fff !important;
  font-size: 11px !important;
  background: linear-gradient(135deg, #dc5806, #ef7620) !important;
  border-color: #ee7e32 !important;
  box-shadow:
    0 10px 22px rgba(218, 82, 2, .27),
    inset 0 1px 0 rgba(255, 255, 255, .2) !important;
}

.a11yNormalButton:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #bd4700, #dc5a08) !important;
  border-color: #f08338 !important;
  transform: translateY(-1px);
}

.a11yPanel :focus-visible,
.a11yEyeBtn:focus-visible,
.a11yMobileBtn:focus-visible {
  outline-color: #ff9a4e !important;
}

@media (max-width: 1180px) {
  .a11yControlsGrid {
    grid-template-columns: minmax(250px, .72fr) minmax(430px, 1.3fr);
  }

  .a11yQuickGroup {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  body.a11y-panel-open {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .a11yMobileBtn {
    position: relative;
    color: #164b65;
    background: #f5fbfc;
    border-color: #cfe3e8;
    box-shadow: 0 6px 16px rgba(17, 69, 93, .09);
  }

  .a11yMobileBtn::after {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
    content: "";
    background: #24bca5;
    border: 2px solid #fff;
    border-radius: 50%;
  }

  .a11yMobileBtn.is-active {
    color: #fff;
    background: linear-gradient(135deg, #0c4565, #0e7592);
    border-color: #0b617f;
  }

  .a11yPanel {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    background:
      radial-gradient(circle at 92% 0%, rgba(53, 188, 197, .18), transparent 34%),
      linear-gradient(145deg, #082d48, #0a536d) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  .a11yPanelInner {
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 20px;
  }

  .a11yPanelHeader,
  .a11yPanelFooter,
  .a11yControlsGrid,
  .a11yAdvancedGrid,
  .a11yControlGroup,
  .a11ySegmented,
  .a11yThemeButtons,
  .a11yQuickButtons,
  .a11yFooterActions {
    min-width: 0;
    max-width: 100%;
  }

  .a11yPanel button,
  .a11yPanel label,
  .a11yPanel legend,
  .a11yPanel span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 900px) {
  .a11yControlsGrid,
  .a11yAdvancedGrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .a11yQuickGroup {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .a11yPanel {
    top: max(6px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom));
    left: max(6px, env(safe-area-inset-left));
    border-radius: 18px;
  }

  .a11yPanelInner {
    padding: 17px 13px 14px;
  }

  .a11yPanelHeader {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .a11yPanel h2 {
    font-size: clamp(21px, 6.6vw, 26px) !important;
  }

  .a11yCloseButton {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: 0 0 40px;
  }

  .a11yControlGroup {
    padding: 12px;
  }

  .a11yThemeButtons button:first-child {
    grid-column: 1 / -1;
  }

  .a11yQuickButtons {
    grid-template-columns: 1fr;
  }

  .a11yPanelFooter {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .a11yFooterActions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .a11yFooterButton,
  .a11yNormalButton {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .a11yPanelInner {
    padding-inline: 11px;
  }

  .a11ySegmentedText {
    grid-template-columns: 1fr;
  }

  .a11yThemeButtons button {
    padding-inline: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11yCloseButton,
  .a11ySegmented button,
  .a11yThemeButtons button,
  .a11yQuickButtons button,
  .a11yNormalButton {
    transform: none !important;
  }
}

.a11yPanel h2:focus-visible {
  outline: none !important;
}

@media (min-width: 1025px) {
  .a11yPanel {
    overflow: clip;
  }
}

.a11yControlGroup legend {
  width: auto;
  margin-left: 3px;
  padding: 3px 8px !important;
  line-height: 1.15 !important;
  background: #f8fbfc !important;
  border: 1px solid #dce7eb !important;
  border-radius: 999px;
  box-shadow: 0 3px 9px rgba(13, 61, 84, .06);
}
