/* Placement for the shared dictation mic. The glyph and recording colors
   come from .studio-agent-mic so every prompt uses the agent microphone. */

.dictation-mic,
.dictation-mic:hover,
.dictation-mic:focus,
.dictation-mic:active {
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  flex: 0 0 auto;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #8e8e93;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.dictation-mic svg {
  width: 16px;
  height: 16px;
}

.dictation-mic:hover,
.dictation-mic.is-recording {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.dictation-mic.is-recording {
  color: #ffb4b4;
  background: rgba(255, 71, 87, 0.16);
}

.dictation-mic .studio-agent-mic-timer {
  font: 600 12px/1 var(--font-main, system-ui);
  font-variant-numeric: tabular-nums;
}

.dictation-mic .studio-agent-mic-timer[hidden] {
  display: none !important;
}

.chat-composer-actions .dictation-mic--composer {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.prompt-box-actions {
  gap: 2px;
}

.prompt-box-actions .dictation-mic {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
}

.chat-input-wrapper .dictation-mic,
.chat-controls-row .dictation-mic,
.s3-chat-input-wrapper .dictation-mic {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
}

.s5-prompt-container > .dictation-mic--s5 {
  position: absolute;
  right: 4px;
  bottom: 8px;
  z-index: 9;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}

html:not(.app-phone) .s5-prompt-tools > .dictation-mic--s5 {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin: 0;
}

html:not(.app-phone) .s5-prompt-tools > .dictation-mic--s5 svg {
  width: 14px;
  height: 14px;
}

.dictation-anchor,
.final-result-box,
.s5-audio-modal-content {
  position: relative;
}

.dictation-mic--corner {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(12, 12, 14, 0.72);
}

textarea.has-dictation,
.s3-style-prompt-wrap textarea,
#final-idea-text,
.s5-audio-modal-content textarea {
  box-sizing: border-box;
}

.s3-style-prompt-wrap textarea,
#final-idea-text,
.s5-audio-modal-content textarea {
  padding-right: 40px;
}

.dictation-toast {
  position: fixed;
  z-index: 4000;
  max-width: min(320px, calc(100vw - 16px));
  padding: 8px 12px;
  border-radius: 12px;
  background: #2a1214;
  color: #ffd0d0;
  border: 1px solid rgba(255, 80, 80, 0.35);
  font: 500 13px/1.35 var(--font-main, system-ui);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.dictation-toast[hidden] {
  display: none !important;
}

html.app-phone .prompt-box-actions .dictation-mic,
html.app-phone .chat-input-wrapper .dictation-mic,
html.app-phone .chat-controls-row .dictation-mic,
html.app-phone .s3-chat-input-wrapper .dictation-mic,
html.app-phone .chat-composer-actions .dictation-mic,
html.app-phone .dictation-mic--corner {
  width: 44px;
  min-width: 44px;
  height: 44px;
}

html.app-phone #stage-5 .s5-prompt-container:not(.is-phone-open) {
  padding-left: 56px;
}

html.app-phone #stage-5.is-phone-collapsed .s5-prompt-container:not(.is-phone-open) {
  padding-left: 46px;
  padding-right: 104px;
}

html.app-phone #stage-5 .s5-prompt-container > .dictation-mic--s5 {
  left: 6px;
  right: auto;
  top: 50%;
  bottom: auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  transform: translateY(-50%);
  z-index: 8;
}

html.app-phone #stage-5.is-phone-collapsed .s5-prompt-container > .dictation-mic--s5 {
  left: auto;
  right: 48px;
}

html.app-phone #stage-5 .s5-prompt-container.is-phone-open > .dictation-mic--s5 {
  left: 8px;
  right: auto;
  top: auto;
  bottom: 8px;
  transform: none;
}

html.app-phone .chat-input-wrapper {
  gap: 8px;
}

html.app-phone .s1-home-workspace .prompt-box .main-textarea {
  min-width: 0;
}
