/* Voice notes share the message bubble; no extra player card or system chrome. */
.conversation-screen .message-files .material-audio.has-custom-voice{background:transparent;padding:0;border:0;border-radius:0}
.voice-note{--voice-accent:var(--green);display:flex;align-items:center;gap:9px;min-width:0;width:100%;min-height:54px;white-space:normal;color:var(--sub);position:relative;flex-wrap:wrap}
.voice-note-play{display:grid;place-items:center;flex:0 0 40px;width:40px;height:44px;min-height:44px;border:0;padding:7px;background:transparent;color:var(--voice-accent);border-radius:50%;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.voice-note-play>svg{width:26px;height:26px;fill:currentColor;stroke:none}
.voice-note-play:focus-visible{outline:2px solid var(--voice-accent);outline-offset:0}
.voice-note-track{flex:1;min-width:45px;align-self:center;display:flex;flex-direction:column;gap:0}
.voice-note-wave{position:relative;min-width:0;width:100%;height:32px;color:var(--sub);--voice-progress:0%}
.voice-note-wave>svg{position:absolute;inset:0;width:100%;height:32px;overflow:visible;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round}
.voice-wave-base{opacity:.30}
.voice-note-wave>.voice-wave-played{color:var(--voice-accent);clip-path:inset(0 calc(100% - var(--voice-progress)) 0 0)}
.voice-note-seek{position:absolute;inset:0;width:100%;height:32px;margin:0;padding:0;border:0;border-radius:0;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer;touch-action:pan-y;color:var(--voice-accent)}
.voice-note-seek:disabled{opacity:.45;cursor:default}
.voice-note-seek:focus-visible{outline:2px solid var(--voice-accent);outline-offset:1px}
.voice-note-seek::-webkit-slider-runnable-track{height:4px;background:transparent}
.voice-note-seek::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;margin-top:-3.5px;width:11px;height:11px;border:0;border-radius:50%;background:var(--voice-accent)}
.voice-note-seek::-moz-range-track{height:4px;background:transparent}
.voice-note-seek::-moz-range-thumb{width:11px;height:11px;border:0;border-radius:50%;background:var(--voice-accent)}
.voice-note-duration{font-size:11px;line-height:16px;font-variant-numeric:tabular-nums;align-self:flex-start;color:var(--sub)}
.voice-note-avatar{flex:0 0 42px;position:relative;display:grid;place-items:center;width:42px;height:42px;order:3;margin-inline:1px}
.voice-note-avatar>.avatar{width:42px;height:42px;font-size:13px}
.voice-note-avatar .presence-dot{display:none}
.voice-note-mic{position:absolute;right:-3px;bottom:-4px;display:grid;place-items:center;width:18px;height:22px;color:var(--voice-accent);filter:drop-shadow(0 1px var(--conversation-incoming,#fff))}
.voice-note-mic>svg{width:17px;height:21px}
.mine .voice-note-avatar{order:-1}
.mine .voice-note-mic{filter:drop-shadow(0 1px var(--conversation-outgoing,#deebdd))}
.voice-note-error{flex:0 0 100%;font-size:11px;line-height:1.4;color:var(--danger);padding:0 4px 3px}
.voice-note .voice-note-audio{display:none!important}
.voice-note.is-draft{padding:4px 0}
.voice-note.is-buffering .voice-note-play>svg{opacity:.5}
.message-dialog .message-actions>a{display:block;border:0;border-bottom:1px solid var(--line);background:transparent;min-height:44px;padding:9px 4px;text-align:left;text-decoration:none;color:inherit}
/* A voice-only bubble puts its clock on the same lower line as the duration. */
.conversation-screen .bubble.has-audio{--voice-avatar-size:42px;--voice-avatar-gap:11px}
.conversation-screen .bubble:has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child)>.message-files{margin-top:0}
.conversation-screen .bubble:has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child) .voice-note-duration{padding-right:64px}
.conversation-screen .bubble:has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child):not(:has(.voice-note-error:not([hidden])))>.message-footer{position:absolute;right:12px;bottom:15px;margin:0}
.conversation-screen .bubble:not(.mine):has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child):has(.voice-note.has-avatar):not(:has(.voice-note-error:not([hidden])))>.message-footer{right:calc(12px + var(--voice-avatar-size) + var(--voice-avatar-gap))}
@media(max-width:400px){.voice-note{gap:5px}.voice-note-play{flex-basis:36px;width:36px;padding:6px}.voice-note-avatar,.voice-note-avatar>.avatar{width:36px;height:36px}.voice-note-avatar{flex-basis:36px}.voice-note-duration{font-size:10px}}
@media(max-width:400px){.conversation-screen .bubble.has-audio{--voice-avatar-size:36px;--voice-avatar-gap:7px}}
/* Voice-only messages occupy the same compact row as a one-line text bubble. */
.conversation-screen .voice-note{min-height:28px;gap:7px}
.conversation-screen .voice-note-play{position:relative;flex-basis:30px;width:30px;height:28px;min-height:28px;padding:3px}
.conversation-screen .voice-note-play::after{content:"";position:absolute;left:-7px;top:-8px;width:44px;height:44px}
.conversation-screen .voice-note-play>svg{width:22px;height:22px}
.conversation-screen .voice-note-wave,.conversation-screen .voice-note-wave>svg,.conversation-screen .voice-note-seek{height:16px}
.conversation-screen .voice-note-duration{font-size:10px;line-height:12px}
.conversation-screen .voice-note-avatar,.conversation-screen .voice-note-avatar>.avatar{width:28px;height:28px;font-size:10px}
.conversation-screen .voice-note-avatar{flex-basis:28px}
.conversation-screen .voice-note-mic{width:12px;height:15px;right:-2px;bottom:-2px}
.conversation-screen .voice-note-mic>svg{width:11px;height:14px}
.conversation-screen .bubble.has-audio{--voice-avatar-size:28px;--voice-avatar-gap:9px}
.conversation-screen .bubble:has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child){padding-block:7px}
.conversation-screen .bubble:has(>.message-text:empty):has(>.message-files>.material-audio.has-custom-voice:only-child):not(:has(.voice-note-error:not([hidden])))>.message-footer{bottom:7px}
/* Duration changes horizontal extent, never the compact voice row height. */
.conversation-screen .bubble.has-audio{width:var(--voice-message-width,260px);max-width:100%}
.conversation-screen .message-files .material-audio.has-custom-voice{width:min(100%,var(--voice-note-width,240px));max-width:100%}
.conversation-screen .voice-note{width:100%;max-width:100%}
.voice-transcript-actions{display:flex;align-items:center;flex:none;order:4}
.voice-transcript-button{display:grid;place-items:center;position:relative;flex:none;width:28px;height:28px;min-height:28px;border:0;background:transparent;border-radius:50%;padding:4px;color:var(--voice-accent,var(--green));touch-action:manipulation}
.voice-transcript-button::after{content:"";position:absolute;inset:-8px}
.voice-transcript-button>svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.voice-transcript-button[aria-busy=true]>svg{opacity:.45}
.voice-transcript-panel{order:10;flex:0 0 100%;min-width:0;width:100%;padding-top:7px;font-size:13px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink)}
.voice-transcript-text{margin:0;white-space:pre-wrap}
.voice-transcript-status{font-size:11px;color:var(--sub);white-space:normal}
.voice-transcript-tools{display:flex;gap:12px;align-items:center;margin-top:5px;white-space:normal}
.voice-transcript-tools>button{border:0;background:transparent;padding:4px 0;min-height:32px;font-size:11px;color:var(--green)}
.conversation-screen .bubble.has-audio:has(.voice-transcript-panel:not([hidden])){width:min(440px,100%)}
.conversation-screen .bubble:has(.voice-transcript-panel:not([hidden]))>.message-footer{position:static!important;margin-top:4px;right:auto;bottom:auto}
.conversation-screen .bubble:has(.voice-transcript-actions):not(:has(.voice-transcript-panel:not([hidden])))>.message-footer{right:calc(12px + 28px + 9px)}
.conversation-screen .bubble:not(.mine):has(.voice-note.has-avatar):has(.voice-transcript-actions):not(:has(.voice-transcript-panel:not([hidden])))>.message-footer{right:calc(12px + 28px + 9px + var(--voice-avatar-size) + var(--voice-avatar-gap))}
.conversation-screen .voice-note:has(.voice-transcript-actions) .voice-note-duration{padding-right:68px}
.composer-preview-voice .voice-note.is-draft{min-height:40px;padding:0}

/* The unsent voice preview occupies the message input itself. */
.compact-composer .composer-input-shell .composer-field-content{display:flex;flex:1;flex-direction:column;min-width:0;align-self:center}
.compact-composer .composer-input-shell .composer-field-content>textarea{width:100%;flex:none}
.composer-inline-voice{min-width:0;width:100%;padding:1px 0}
.composer-inline-voice .composer-preview-voice{flex:1 1 auto;min-width:0;max-width:none;width:100%;padding:0 32px 0 0}
.composer-inline-voice .voice-note.is-draft{min-height:40px;padding:0}
.composer-inline-voice .composer-preview-voice>.composer-preview-remove{top:4px;right:0}
.composer-inline-voice .composer-preview-voice>audio{height:40px}
