/* TTS — tích hợp reader */

.voice-gender {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.voice-gender__toggle {
  font-family: "Phetsarath OT", "Saysettha OT", "Noto Sans Lao", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 52px;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong, #c5d0de);
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  background: #fff;
  color: #1a2332;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.voice-gender__toggle:active {
  transform: scale(0.97);
}

.voice-gender__toggle--male {
  background: #fff;
  color: #0f172a;
  border-color: #94a3b8;
}

.voice-gender__toggle--female {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #a78bfa;
}

.voice-gender__toggle:hover,
.voice-gender__toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
  outline: none;
}

.lao-word,
.lao-sentence {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.lao-word:hover,
.lao-word:focus-visible,
.lao-sentence:hover,
.lao-sentence:focus-visible {
  background: rgba(20, 184, 166, 0.14);
  outline: none;
}

.lao-word.lao-speaking,
.lao-sentence.lao-speaking {
  background: rgba(20, 184, 166, 0.28);
}

.lao-sentence {
  display: inline;
  border-radius: 4px;
}

p.lao.lao-sentence {
  display: block;
  padding: 0.15rem 0.25rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
}

#grammar-tts-status {
  position: fixed;
  left: 50%;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: min(90vw, 320px);
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  border-radius: 10px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#grammar-tts-status[hidden] {
  display: none;
}
