/* Self-contained styles for the shared browser read-aloud controls. */
#gllx-speech {
  --gllx-speech-ink: #172039;
  --gllx-speech-teal: #49d4c4;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: calc(100vw - 32px);
  color: var(--gllx-speech-ink);
  font: 16px/1.45 'Acme', system-ui, sans-serif;
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
  isolation: isolate;
}
#gllx-speech, #gllx-speech * { box-sizing: border-box; }
#gllx-speech [hidden] { display: none !important; }
#gllx-speech button, #gllx-speech select, #gllx-speech a {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}
#gllx-speech button, #gllx-speech select {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  border: 1px solid #bec8cd;
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
  color: var(--gllx-speech-ink);
  box-shadow: none;
  line-height: 1.25;
  font-weight: 400;
}
#gllx-speech button { cursor: pointer; }
#gllx-speech button:hover:not(:disabled) { background: #e5f9f5; border-color: #147b71; }
#gllx-speech button:disabled { opacity: .5; cursor: not-allowed; }
#gllx-speech :is(button, select, a):focus-visible {
  outline: 3px solid #265bbd;
  outline-offset: 3px;
}
#gllx-speech .gllx-speech-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 109px;
  min-height: 48px;
  padding: 11px 17px;
  border: 1px solid #17443f;
  border-radius: 999px;
  background: var(--gllx-speech-ink);
  color: #fff;
  box-shadow: 0 4px 18px rgb(16 26 53 / 23%);
}
#gllx-speech .gllx-speech-launcher svg { flex: 0 0 auto; color: var(--gllx-speech-teal); }
#gllx-speech .gllx-speech-launcher:hover:not(:disabled) { color: #fff; background: #24413f; }
#gllx-speech[data-state="playing"] .gllx-speech-launcher { border-color: #177b6e; background: #14574f; }
#gllx-speech .gllx-speech-panel {
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 18px;
  border: 1px solid #ced5d7;
  border-top: 4px solid var(--gllx-speech-teal);
  border-radius: 16px;
  background: #fbfaf5;
  box-shadow: 0 10px 40px rgb(16 26 53 / 23%);
  outline: none;
}
#gllx-speech .gllx-speech-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#gllx-speech h2 {
  margin: 0;
  padding: 0;
  color: var(--gllx-speech-ink);
  font: 400 22px/1.2 'Acme', system-ui, sans-serif;
  letter-spacing: -.02em;
}
#gllx-speech p { margin: 0; font: inherit; }
#gllx-speech .gllx-speech-voice { margin-top: 5px; color: #436b61; font-size: 13px; }
#gllx-speech .gllx-speech-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font: 26px/1 system-ui, sans-serif;
}
#gllx-speech .gllx-speech-disclosure { margin: 14px 0; color: #455369; font-size: 13px; line-height: 1.45; }
#gllx-speech .gllx-speech-voice-label { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0 0 14px; color: #455369; font-size: 12px; }
#gllx-speech .gllx-speech-voice-label select { display: block; width: 100%; max-width: 100%; min-width: 0; font-size: 14px; text-overflow: ellipsis; }
#gllx-speech .gllx-speech-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#gllx-speech .gllx-speech-primary { background: var(--gllx-speech-teal); border-color: #208779; }
#gllx-speech .gllx-speech-primary:hover:not(:disabled) { background: #78e1d3; }
#gllx-speech .gllx-speech-selection-hint { margin-top: 8px; color: #596278; font-size: 12px; line-height: 1.4; }
#gllx-speech .gllx-speech-playback { display: grid; grid-template-columns: 1fr 1fr minmax(74px, 1fr); align-items: end; gap: 8px; margin-top: 17px; }
#gllx-speech .gllx-speech-speed-label { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 12px; color: #455369; }
#gllx-speech .gllx-speech-speed-label select { width: 100%; padding-right: 5px; font-size: 15px; }
#gllx-speech .gllx-speech-status { margin-top: 15px; padding: 10px 11px; background: #e9f3ee; border-radius: 8px; color: #294e42; font-size: 13px; overflow-wrap: anywhere; }
#gllx-speech .gllx-speech-status[data-error="true"] { background: #fff0d5; color: #70420e; }
#gllx-speech .gllx-speech-retry { width: 100%; margin-top: 9px; }
#gllx-speech .gllx-speech-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@supports not (height: 100dvh) {
  #gllx-speech .gllx-speech-panel { max-height: calc(100vh - 96px); }
}
@media (max-width: 360px) {
  #gllx-speech { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-width: calc(100vw - 20px); }
  #gllx-speech .gllx-speech-panel { max-width: calc(100vw - 20px); padding: 14px; }
  #gllx-speech button { padding-right: 8px; padding-left: 8px; }
}
@media print { #gllx-speech { display: none !important; } }
