/* Voice input / read aloud */
.elder-speech-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.elder-speech-input-wrap--banner {
  flex: 1;
}

.elder-speech-input-wrap input[type="search"],
.elder-speech-input-wrap input[type="text"] {
  flex: 1;
  min-width: 0;
}

.elder-speech-mic,
.elder-speech-speak {
  flex-shrink: 0;
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid #00a99d;
  border-radius: 10px;
  background: #fff;
  color: #1e5f74;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.elder-speech-mic:hover,
.elder-speech-mic:focus,
.elder-speech-speak:hover,
.elder-speech-speak:focus {
  background: #e6f7f5;
  outline: 3px solid #ffea00;
}

.elder-speech-mic.is-listening {
  background: #ff6b6b;
  border-color: #c0392b;
  color: #fff;
  animation: elder-mic-pulse 1s ease infinite;
}

.elder-speech-speak.is-speaking {
  background: #00a99d;
  color: #fff;
}

@keyframes elder-mic-pulse {
  50% {
    opacity: 0.85;
  }
}

.elder-chat-input-row.elder-speech-input-wrap {
  padding-right: 4px;
}

.elder-chat-input-row .elder-speech-mic {
  min-width: 44px;
  min-height: 44px;
}

.elder-chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.08);
}

.elder-chat-toolbar button {
  font-size: 0.8rem;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.elder-chat-toolbar button[aria-pressed="true"] {
  background: #ffea00;
  color: #000;
  border-color: #ffea00;
}

.elder-chat-msg {
  position: relative;
  padding-right: 44px;
}

.elder-chat-msg .elder-speech-speak {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 36px;
  min-height: 36px;
  padding: 4px;
  font-size: 1rem;
}

.elder-chat-msg.user {
  padding-right: 14px;
}

.elder-chat-msg.user .elder-speech-speak {
  display: none;
}

.banner-section .form-group {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.banner-section .elder-speech-input-wrap {
  flex: 1;
  min-width: 200px;
}

.banner-section .form-group > button[type="submit"] {
  flex-shrink: 0;
  min-width: 48px;
  min-height: 48px;
}
