#ae-accessibility-exaden-toggle {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #222; color: #fff; padding: 12px 18px; border-radius: 30px;
  font-size: 1.1rem; text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.2s;
}
#ae-accessibility-exaden-toggle:hover { background: #444; }

/* Regole per il ridimensionamento del testo con alta specificità */
:root[style*="--ae-font-size-multiplier"] * {
  font-size: calc(var(--ae-font-size-multiplier, 1) * 1em) !important;
}

/* Specificità ancora maggiore per elementi con font-size specifico */
:root[style*="--ae-font-size-multiplier"] *[style*="font-size"] {
  font-size: calc(var(--ae-font-size-multiplier, 1) * var(--original-font-size, 1em)) !important;
}

/* Regole per elementi specifici che potrebbero avere !important */
:root[style*="--ae-font-size-multiplier"] h1,
:root[style*="--ae-font-size-multiplier"] h2,
:root[style*="--ae-font-size-multiplier"] h3,
:root[style*="--ae-font-size-multiplier"] h4,
:root[style*="--ae-font-size-multiplier"] h5,
:root[style*="--ae-font-size-multiplier"] h6,
:root[style*="--ae-font-size-multiplier"] p,
:root[style*="--ae-font-size-multiplier"] span,
:root[style*="--ae-font-size-multiplier"] div,
:root[style*="--ae-font-size-multiplier"] a,
:root[style*="--ae-font-size-multiplier"] li,
:root[style*="--ae-font-size-multiplier"] button,
:root[style*="--ae-font-size-multiplier"] input,
:root[style*="--ae-font-size-multiplier"] textarea,
:root[style*="--ae-font-size-multiplier"] label {
  font-size: calc(var(--ae-font-size-multiplier, 1) * 1em) !important;
}

#accessibility-exaden-menu {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%) translateX(60px);
  background: #fff; border-radius: 13px 0 0 13px; box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  padding: 5px 0 5px 5px; z-index: 2147483647; min-width: 200px; max-width: 90vw;
  font-family: inherit; opacity: 0; pointer-events: none;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
}
#accessibility-exaden-menu.ae-open {
  opacity: 1; transform: translateY(-50%) translateX(0); pointer-events: auto;
}
.ae-menu { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.ae-btn { padding: 7px 10px !important; gap: 6px !important; justify-content: start !important; }
.ae-btn, .ae-btn-fixed {
  display: flex; align-items: center; gap: 4px !important; width: 100%; text-align: left; justify-content: start !important;
  background: #f5f5f5; border: none !important; border-radius: 8px 0 0 8px !important; cursor: pointer !important;
  transition: background 0s, box-shadow 0.1s, transform 0.05s !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
  font-size: 0.9rem !important; min-height: 40px !important;
}
.ae-btn:hover, .ae-btn:focus, .ae-btn:active, .ae-btn-fixed:hover, .ae-btn-fixed:focus, .ae-btn-fixed:active {
  background: #ffe600; color: #222; outline: none !important; border: none !important; transform: none !important;
}
.ae-btn:focus { box-shadow: 0 2px 8px rgba(0,0,0,0.10); transform: translateX(4px) scale(1.04); }
.ae-btn-fixed { width: auto; min-width: 180px; max-width: 100vw; border-radius: 0px 8px 8px 0px !important; min-height: 35px; justify-content: flex-start !important; padding: 4px 8px 4px 10px !important; background: #f1f1f1;}
.ae-btn-fixed.ae-tts-active { background: #ffe600 !important; color: #222; }

/* Stili per il lampeggiamento del pulsante TTS */
.ae-btn-fixed[style*="background-color"] {
  transition: background-color 0.35s cubic-bezier(.4,0,.2,1) !important;
}

/* Assicurati che il colore verde del lampeggiamento abbia priorità */
.ae-btn-fixed[style*="background-color: rgb(57, 230, 57)"] {
  background-color: #39e639 !important;
  color: #222 !important;
}
.ae-icon {
  height: 2.5em; width: 2.5em; min-width: 1.4em !important; max-width: 1.4em !important; max-height: 1.4em !important;
  margin-right: 4px  !important; display: inline-block; vertical-align: middle !important;
}
.ae-label { font-weight: 500; font-size: 1em; color: #4a4c53; vertical-align: middle !important; margin-bottom: -2px !important;}
.ae-link-highlight {
  background: #f7e378 !important; color: #d13264 !important; border-bottom: 4px solid #f7d486 !important;
  padding: 0px 6px !important; border-radius: 4px; transition: background 0.2s, color 0.2s;
}
.ae-grayscale { filter: grayscale(1) !important; }
.ae-stop-animations *, .ae-stop-animations *:before, .ae-stop-animations *:after {
  animation: none !important; transition: none !important;
}
.ae-letter-spacing { letter-spacing: 0.15em !important; }
.ae-invert { filter: invert(1) hue-rotate(180deg) !important; }
.ae-invert img, .ae-invert svg { filter: none !important; }
.ae-big-cursor, .ae-big-cursor * { cursor: url('../img/cursor.svg') 2 2, auto !important; }
.ae-big-cursor a, .ae-big-cursor a * { cursor: url('../img/pointer.svg') 2 2, pointer !important; }
@media (max-width:600px) {
  #accessibility-exaden-menu { right: 0; min-width: 160px; padding: 6px 0 6px 6px; top: 50%; }
  #accessibility-exaden-toggle { right: 8px; bottom: 8px; padding: 12px 16px; font-size: 1.1rem; }
  .ae-menu { gap: 6px; }
  .ae-btn { padding: 8px 15px 8px 10px; font-size: 0.98rem; min-height: 28px; gap: 0px !important; vertical-align: middle;} 
  .ae-icon { height: 1em; width: 1.4em; min-width: 1.4em; min-height: 1.2em; max-width: 1.2em; max-height: 1.2em; margin-right: 8px; vertical-align: middle;}
  #ae-big-cursor { display: none !important; }
  #ae-tts-fixed { left: 0px !important; bottom: 100px; gap: 3px; padding: 5px 5px 5px 0px !important;}
  .ae-btn-fixed { min-width: 120px; width: auto; max-width: none; min-height: 36px; padding: 6px 6px 6px 16px !important; font-size: 0.98rem; box-sizing: border-box; display: block; border-radius: 0px 6px 6px 0px !important;}
  .ae-label { vertical-align: middle; }
}
#ae-tts-fixed {
  position: fixed; left: 0px; bottom: 100px; z-index: 2147483647; padding: 5px 5px 5px 0px; opacity: 0.89;
  display: flex; flex-direction: column; gap: 5px; background: #ffffff; border-radius: 0px 10px 10px 0px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
} 
#ae-tts-fixed .ae-icon {
  height: 1em; width: 1em; min-width: 1.5em; max-width: 1.5em; max-height: 2em;
}
.ae-tts-fade-in {
  animation: aeTtsFadeIn 0.35s cubic-bezier(.4,0,.2,1) forwards;
}
.ae-tts-fade-out {
  animation: aeTtsFadeOut 0.35s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes aeTtsFadeIn {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 0.89; transform: translateX(0); }
}
@keyframes aeTtsFadeOut {
  from { opacity: 0.89; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}

/* Stile per i pulsanti quando si raggiunge il limite */
.ae-btn.ae-limit-reached {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: #e0e0e0 !important;
  color: #999 !important;
}
.ae-btn.ae-limit-reached:hover, .ae-btn.ae-limit-reached:focus, .ae-btn.ae-limit-reached:active {
  background: #e0e0e0 !important;
  color: #999 !important;
  transform: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
}