.voice-capture-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 35, 31, .68);
  backdrop-filter: blur(6px);
}

.voice-capture-layer[hidden] {
  display: none;
}

.voice-capture-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #dce3dd;
  border-radius: 22px;
  background: #fffefa;
  padding: clamp(20px, 5vw, 32px);
  box-shadow: 0 26px 80px rgba(24, 44, 38, .3);
}

.voice-capture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.voice-capture-head h2 {
  margin: 3px 0 6px;
  font: 29px Georgia, serif;
  color: #202b37;
}

.voice-close {
  width: 38px;
  height: 38px;
  border: 1px solid #e2e6e1;
  border-radius: 50%;
  background: white;
  color: #50605b;
  font-size: 22px;
}

.voice-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin: 18px 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: #eef5f1;
  color: #365c53;
}

.voice-state.recording {
  background: #f7ece9;
  color: #8b3d35;
}

.voice-pulse {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border-radius: 50%;
  background: #24796f;
}

.voice-state.recording .voice-pulse {
  background: #bf4a40;
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  50% { transform: scale(1.45); opacity: .55; }
}

.voice-label {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  font-weight: 700;
  color: #354640;
}

.voice-transcript {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid #d5ddd8;
  border-radius: 12px;
  background: white;
  padding: 13px 14px;
  font-weight: 400;
  line-height: 1.55;
  outline: none;
}

.voice-transcript:focus {
  border-color: #4f9488;
  box-shadow: 0 0 0 3px #dceee8;
}

.voice-help {
  margin: 8px 0 0;
  color: #71808c;
  font-size: 12px;
}

.voice-preview {
  width: 100%;
  margin-top: 14px;
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 19px;
}

.voice-action {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-weight: 700;
}

.voice-action.primary {
  background: #24796f;
  color: white;
}

.voice-action.stop {
  background: #9d4038;
  color: white;
}

.voice-action.soft {
  background: #e8f2ee;
  color: #276b61;
}

.voice-action.outline {
  border: 1px solid #dce2de;
  background: white;
  color: #354640;
}

.voice-action[hidden] {
  display: none;
}

.voice-audio-row {
  margin-top: 10px;
}

.voice-audio-row audio {
  width: min(100%, 360px);
  height: 36px;
}

@media (max-width: 580px) {
  .voice-capture-layer {
    align-items: end;
    padding: 0;
  }

  .voice-capture-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .voice-actions .voice-action {
    flex: 1 1 45%;
  }
}
