/* ============================================================
   HOA Resource Finder — Speech-to-Text dictation controls
   Pairs with assets/js/speech-to-text.js. Uses the style.css tokens.
   ============================================================ */

.stt-bar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .3rem;
  font-family: 'Lato', sans-serif;
}

.stt-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .8rem;
  line-height: 1.35;
  text-align: right;
  padding-top: .45rem;
}
.stt-status { color: var(--gray-500, #6b7a99); }
.stt-status:empty { display: none; }
.stt-has-error .stt-status { color: #c62828; font-weight: 700; }

/* Interim words: shown here only, never written into the field until final */
.stt-preview {
  color: var(--gray-700, #3d4a63);
  font-style: italic;
  overflow-wrap: anywhere;
}
.stt-preview:empty { display: none; }
.stt-preview::before { content: '\201C'; }
.stt-preview::after  { content: '\2026\201D'; }

.stt-notice {
  margin-top: .35rem;
  padding: .4rem .6rem;
  border: 1px solid var(--blue-100, #e3f0ff);
  border-radius: var(--radius-sm, 8px);
  background: var(--blue-50, #f0f6ff);
  color: var(--gray-700, #3d4a63);
  text-align: left;
}
.stt-notice i { color: var(--blue-700, #1565C0); }

/* Microphone button */
.stt-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--gray-300, #c8d2e4);
  border-radius: var(--radius-sm, 8px);
  background: var(--white, #fff);
  color: var(--blue-700, #1565C0);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.stt-btn:hover { background: var(--blue-50, #f0f6ff); border-color: var(--blue-700, #1565C0); }
.stt-btn:focus-visible {
  outline: 3px solid var(--orange-400, #FFB74D);
  outline-offset: 2px;
}
.stt-btn.is-listening {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
  animation: stt-pulse 1.4s ease-out infinite;
}
.stt-btn.is-processing {
  background: var(--orange-50, #fff8f0);
  border-color: var(--orange-500, #F5A623);
  color: var(--orange-700, #e07b00);
}

@keyframes stt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(198, 40, 40, .45); }
  100% { box-shadow: 0 0 0 9px rgba(198, 40, 40, 0); }
}

/* Touch screens and phones: 44px target */
@media (pointer: coarse), (max-width: 575.98px) {
  .stt-btn { width: 44px; height: 44px; font-size: 1.05rem; }
  .stt-text { padding-top: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .stt-btn, .stt-btn.is-listening { animation: none; transition: none; }
}

@media print { .stt-bar { display: none !important; } }
