.speech-input {
  position: relative;
}

.speech-input .speech-to-text-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speech-input .speech-to-text-btn i {
  font-size: 16px;
  position: static;
  left: auto;
  top: auto;
  transform: none;
  pointer-events: none;
}

.speech-input .speech-to-text-btn.is-listening {
  color: var(--primary-color);
}

.speech-input .form-control {
  padding-right: 42px;
}

.speech-input img {
  pointer-events: none;
}

.speech-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 999999;
}

.speech-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.speech-overlay-card {
  background: #ffffff;
  color: #111827;
  padding: 24px 28px;
  border-radius: 16px;
  text-align: center;
  min-width: 240px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.speech-overlay-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.speech-overlay-icon i {
  font-size: 22px;
  color: var(--primary-color);
}

.speech-overlay-text {
  font-size: 18px;
  font-weight: 600;
}

.speech-overlay-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

[dir="rtl"] .speech-input .speech-to-text-btn {
  right: auto;
  left: 12px;
}

[dir="rtl"] .speech-input .form-control {
  padding-left: 42px;
  padding-right: 45px;
}
