/* Local TTS demo */

#tts-app {
  max-width: 720px;
  margin: 2em auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tts-status-bar {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  background: #f0f4f8;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.tts-status-bar[data-kind="loading"] {
  background: #fef9c3;
  color: #713f12;
  border-color: #facc15;
}

.tts-status-bar[data-kind="ready"] {
  background: #ecfdf5;
  color: #065f46;
  border-color: #6ee7b7;
}

.tts-status-bar[data-kind="error"] {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

#tts-progress {
  height: 18px;
  background: #e2e8f0;
  border-radius: 9px;
  overflow: hidden;
  margin: 12px 0;
  font-size: 0.75rem;
}

#tts-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  color: white;
  text-align: center;
  line-height: 18px;
  width: 0;
  transition: width 0.2s ease;
}

.tts-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.tts-controls label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

#tts-voice {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  background: white;
  width: 100%;
  cursor: pointer;
}

#tts-voice:focus {
  outline: none;
  border-color: #6366f1;
}

#tts-text {
  width: 100%;
  min-height: 120px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}

#tts-text:focus {
  outline: none;
  border-color: #6366f1;
}

#tts-speak {
  padding: 12px 28px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  align-self: flex-start;
}

#tts-speak:hover:not(:disabled) {
  background: #4338ca;
}

#tts-speak:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#tts-audio {
  width: 100%;
  margin-top: 12px;
}

.tts-caveat {
  margin-top: 16px;
  padding: 10px 14px;
  background: #f0f4f8;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #475569;
}
