.speech-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 4px;
  color: #57416e;
  font-size: 12px;
  line-height: 1.4;
}
.speech-tools button, .speech-tools select {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.speech-tools select { min-width: 48px; font-variant-numeric: tabular-nums; }
.speech-tools .speech-play { display: inline-flex; align-items: center; gap: 5px; }
.speech-play svg { width: 16px; height: 16px; }
.speech-tools button:hover, .speech-tools select:hover { background: #eee9f1; }
.speech-tools :focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.speech-tools button:disabled { cursor: default; color: #736c75; }
.speech-tools [hidden], .speech-notice:empty { display: none; }
.speech-notice { flex-basis: 100%; }
.chat-message-footer { flex-wrap: wrap; }
.chat-message-footer:has(.speech-tools) .chat-actions { margin-inline-start: auto; }
.reading-status:has(.speech-tools) { align-items: center; }
@media (pointer: coarse) {
  .speech-tools button, .speech-tools select { min-height: 44px; }
}

.voice-picker {
  width:min(410px,calc(100% - 24px));
  max-height:min(82dvh,680px);
  margin:auto;
  padding:0;
  overflow:hidden;
  border:1px solid #d3cbd0;
  border-radius:19px;
  background:var(--paper,#f7f5f0);
  color:var(--ink,#231f27);
  box-shadow:0 16px 55px rgb(34 26 37 / .18);
}
.voice-picker[open] { display:flex; flex-direction:column; }
.voice-picker::backdrop { background:rgb(42 34 45 / .36); }
.voice-picker header,.voice-picker footer { padding:12px 20px; flex:none; }
.voice-picker header { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #ded8d3; }
.voice-picker h2 { font:600 23px/1.4 var(--serif,serif); }
.voice-picker [data-dismiss] { width:40px; height:40px; border-radius:50%; background:transparent; color:#655a66; font-size:24px; }
.voice-picker-body { padding:15px 20px 16px; overflow:auto; overscroll-behavior:contain; }
.voice-picker h3 { color:#44364c; font:650 14px/1.5 var(--sans,sans-serif); }
.voice-picker-note { margin:5px 0 10px; font-size:12px; line-height:1.6; color:#675e68; }
.voice-picker .voice-option { display:flex; align-items:center; gap:6px; min-height:47px; border-bottom:1px solid #e0d9d6; }
.voice-choice { display:flex; min-width:0; align-items:center; flex:1; flex-wrap:wrap; column-gap:8px; min-height:44px; cursor:pointer; font-size:15px; }
.voice-choice input { width:17px; height:17px; margin:0 2px 0 0; accent-color:#59416d; }
.voice-choice small { font-size:12px; color:#766b75; }
.voice-choice:has(input:checked) { color:#523a65; font-weight:650; }
.voice-choice:has(input:disabled) { color:#716a71; cursor:default; }
.voice-picker button.voice-preview { display:inline-flex; align-items:center; gap:5px; flex:none; min-height:44px; padding:0 5px; color:#59416d; background:transparent; font-size:13px; }
.voice-preview::before { content:""; width:0; height:0; border:4px solid transparent; border-right:0; border-left:6px solid currentColor; }
.voice-preview.is-playing::before { width:7px; height:7px; border:0; background:currentColor; }
.voice-picker .voice-preview:disabled { color:#807780; cursor:default; }
.voice-device { margin-top:20px; }
.voice-picker [data-device-list] { display:block; width:100%; min-height:42px; margin-top:8px; padding:6px 9px; color:inherit; background:#fcfaf6; border:1px solid #d7cfcf; border-radius:8px; font:inherit; }
.voice-picker footer { border-top:1px solid #dcd5d1; }
.voice-picker-status { margin:0 0 8px; color:#5f405e; font-size:13px; line-height:1.6; }
.voice-picker-status:empty { display:none; }
.voice-apply { width:100%; height:44px; border-radius:9px; background:#4d395e; color:white; font-size:14px; font-weight:600; }
.voice-apply:disabled { background:#dbd6dd; color:#726973; }
.voice-picker :is(button,input,select):focus-visible { outline:2px solid #75598a; outline-offset:1px; }
@media (any-pointer:coarse) {
  .speech-tools select,.voice-picker [data-device-list] { font-size:16px; }
}
@media(max-width:520px) {
  .voice-picker { max-height:calc(100dvh - 22px - env(safe-area-inset-bottom)); margin:auto auto max(8px,env(safe-area-inset-bottom)); }
}
@media(prefers-reduced-motion:no-preference) {
  .voice-picker[open] { animation:edition-enter .16s ease-out; }
}
.voice-settings-trigger {
  display:inline-flex; gap:6px; align-items:center; justify-content:center;
  min-height:44px; padding:5px 2px; border:0; border-radius:6px;
  color:#59416d; background:transparent; font:570 13px/1.4 var(--sans,sans-serif);
}
.voice-settings-trigger svg { width:16px; height:16px; flex:none; }
.chat-discovery-actions { grid-row:3; display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:5px; }
.chat-discovery-actions button.chat-shuffle { margin-top:0; }
.model-settings-page .voice-settings-trigger { margin-top:6px; }
@media(hover:hover) {
  .voice-settings-trigger:hover,.voice-picker button.voice-preview:hover:not(:disabled) { color:#39283e; background:#eee7ed; }
}
