.voice-input-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  gap: 0.35rem;
}

.voice-input-field.has-clear.has-voice {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.voice-input-field > input {
  width: 100%;
  min-width: 0;
}

.voice-input-toggle,
.voice-input-clear {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 2.9rem !important;
  min-width: 2.9rem !important;
  min-height: 2.75rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #5f8588 !important;
  border-radius: 0.45rem !important;
  background: #0b3336 !important;
  color: #f2faf8 !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: manipulation;
}

.voice-input-clear {
  width: 2.55rem !important;
  min-width: 2.55rem !important;
  border-color: #49666a !important;
  background: #10272b !important;
  color: #d7e7e4 !important;
  font: 500 1.65rem/1 system-ui, sans-serif !important;
}

.voice-input-clear[hidden] {
  display: none !important;
}

.voice-input-toggle:hover,
.voice-input-toggle:focus-visible,
.voice-input-clear:hover,
.voice-input-clear:focus-visible {
  border-color: #75d8d2 !important;
  background: #12484b !important;
  outline: 2px solid transparent;
}

.voice-input-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.voice-input-toggle.is-listening {
  border-color: #f2cb5f !important;
  background: #674d08 !important;
  color: #fff4bd !important;
  box-shadow: 0 0 0 0.2rem rgba(242, 203, 95, 0.2) !important;
  animation: voice-input-pulse 1.35s ease-in-out infinite;
}

.voice-input-toggle.has-error {
  border-color: #ef8b79 !important;
  color: #ffd8d1 !important;
}

.ring-center .voice-input-field {
  gap: .2rem;
}

.ring-center .voice-input-toggle,
.ring-center .voice-input-clear {
  width: 2.1rem !important;
  min-width: 2.1rem !important;
  min-height: 2rem;
  border-radius: .3rem !important;
}

.ring-center .voice-input-clear {
  width: 1.9rem !important;
  min-width: 1.9rem !important;
  font-size: 1.35rem !important;
}

.ring-center .voice-input-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

@keyframes voice-input-pulse {
  0%, 100% { box-shadow: 0 0 0 0.15rem rgba(242, 203, 95, 0.16); }
  50% { box-shadow: 0 0 0 0.38rem rgba(242, 203, 95, 0.08); }
}

@media (max-width: 720px) {
  .voice-input-toggle {
    width: 3rem !important;
    min-width: 3rem !important;
    min-height: 3rem;
  }

  .voice-input-clear {
    width: 3rem !important;
    min-width: 3rem !important;
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-input-toggle.is-listening { animation: none; }
}
