.question-box .question-input::part(textarea) {
  padding-right: 104px;
  padding-bottom: 48px;
}

.voice-stt-button {
  position: absolute;
  right: 54px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  color: var(--blue, #1d70f5);
}

.voice-stt-button::part(base) {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong, #bad0ec);
  border-radius: 10px;
  color: inherit;
  background: var(--panel-2, #f8fbff);
  box-shadow: none;
}

.voice-stt-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-stt-button[aria-pressed="true"]::part(base) {
  border-color: var(--red, #ef4444);
  color: var(--red, #ef4444);
  animation: voice-stt-pulse 1.4s ease-in-out infinite;
}

.voice-stt-button[disabled]::part(base) {
  cursor: not-allowed;
  opacity: .5;
}

.voice-stt-status {
  position: absolute;
  right: 98px;
  bottom: 18px;
  left: 10px;
  overflow: hidden;
  color: var(--muted, #64748b);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.voice-stt-status[data-state="recording"] { color: var(--red, #ef4444); }
.voice-stt-status[data-state="success"] { color: var(--green, #10b981); }
.voice-stt-status[data-state="error"] { color: var(--red, #ef4444); }

@keyframes voice-stt-pulse {
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red, #ef4444) 18%, transparent); }
}

@media (max-width: 520px) {
  .question-box .question-input::part(textarea) { padding-right: 96px; }
  .voice-stt-button { right: 48px; width: 34px; height: 34px; }
  .voice-stt-button::part(base) { width: 34px; height: 34px; min-height: 34px; }
  .voice-stt-status { right: 88px; bottom: 16px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .voice-stt-button[aria-pressed="true"]::part(base) { animation: none; }
}

/* Reserve distinct rows for the real Shoelace textarea and its actions. */
html.cyberclaw-light .question-box{display:grid;grid-template-rows:minmax(42px,1fr) auto;min-height:100px}
html.cyberclaw-light .question-box sl-textarea.question-input{height:100%;min-height:0;overflow:hidden}
html.cyberclaw-light .question-box sl-textarea.question-input::part(form-control),
html.cyberclaw-light .question-box sl-textarea.question-input::part(form-control-input){height:100%;min-height:0}
html.cyberclaw-light .question-box sl-textarea.question-input::part(base){height:100%;max-height:100%}
html.cyberclaw-light .question-box sl-textarea.question-input::part(textarea){height:100%;min-height:0;max-height:100%;padding:10px;box-sizing:border-box}
.question-toolbar{display:flex;align-items:center;gap:6px;flex:0 0 auto;min-width:0;padding:5px 7px}
.question-toolbar .voice-stt-status{position:static;flex:1 1 auto;min-width:0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;line-height:1.3}
.question-toolbar .voice-stt-button,.question-toolbar .send-btn{position:static;flex:0 0 36px;width:36px;height:36px;min-width:36px}
.question-toolbar .voice-stt-button::part(base),.question-toolbar .send-btn::part(base){width:36px;height:36px;min-height:36px}
