.ct-compose{position:relative;--ct-control-size:44px;--ct-voice-fill:#f04b55;--ct-voice-wave-fill:#f04b554d;--ct-voice-wave-line:#f76b7466;--ct-voice-wave-soft:#f04b5533;--ct-voice-wave-soft-line:#f76b7433;--ct-compose-padding:24px;--ct-safe-bottom:env(safe-area-inset-bottom);padding-top:var(--ct-compose-padding);padding-bottom:calc(var(--ct-compose-padding) + var(--ct-safe-bottom));--ct-voice-center-right:66px;--ct-voice-center-bottom:calc(var(--ct-compose-padding) + 24px + var(--ct-safe-bottom));--ct-attach-space:50px;--ct-motion-time:.6s;--ct-motion-ease:cubic-bezier(.22,1,.36,1);--ct-motion-spring:cubic-bezier(.22,1.3,.36,1)}
.ct-input-wrap{position:relative;margin-right:78px;padding-right:14px;min-height:48px}
.ct-compose[data-compose-kind=text] .ct-input-wrap{margin-right:0;padding-right:58px}
.ct-voice-button{margin:0;width:var(--ct-control-size);height:var(--ct-control-size);position:absolute;right:calc(var(--ct-voice-center-right) - 22px);bottom:calc(var(--ct-voice-center-bottom) - 22px);color:var(--ct-muted);border:1px solid #8096aa55;touch-action:none;user-select:none;-webkit-user-select:none}
.ct-compose>#ct-attach{width:var(--ct-control-size);height:var(--ct-control-size);margin-bottom:2px}
.ct-compose #ct-send{position:absolute;right:2px;bottom:1px;width:var(--ct-control-size);height:var(--ct-control-size);padding:9px;border-radius:0;background:transparent;isolation:isolate}
.ct-compose #ct-send::before{content:'';position:absolute;inset:0;background:var(--ct-accent);z-index:-1;-webkit-mask:url('./send-button-shape.svg') center/100% 100% no-repeat;mask:url('./send-button-shape.svg') center/100% 100% no-repeat}
/* Keep both absolute controls mounted while their icons fade and turn. */
.ct-compose[data-compose-kind] .ct-voice-button[hidden],.ct-compose[data-compose-kind] #ct-send[hidden]{display:inline-flex!important;visibility:hidden;opacity:0;pointer-events:none}
.ct-compose .ct-voice-button[hidden] svg,.ct-compose #ct-send[hidden] svg{transform:scale(.75) rotate(-18deg)}
.ct-voice-button::before{content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;z-index:0}
.ct-voice-button svg{z-index:1;position:relative;pointer-events:none}.ct-voice-button[hidden],.ct-voice-bar[hidden],.ct-voice-pause[hidden],.ct-voice-lock[hidden]{display:none}
.ct-voice-bar{position:absolute;inset:-1px;display:flex;gap:9px;align-items:center;z-index:2;border:1px solid #8096aa55;border-radius:24px;padding:0 12px;background:#151e31;white-space:nowrap;overflow:hidden}
.ct-compose:not([data-recording=idle]) .ct-voice-bar{left:calc(-1px - var(--ct-attach-space) * (1 - var(--voice-cancel-progress,0)))}
.ct-voice-trash{position:absolute;left:16px;bottom:calc(var(--ct-compose-padding) + 2px + var(--ct-safe-bottom));z-index:4;color:#f04b55;border:1px solid #f04b554d;background:#25314b;pointer-events:none;visibility:hidden;opacity:0;transform:scale(.8)}
.ct-compose[data-recording=held][data-voice-cancel-drag] .ct-voice-trash{visibility:visible;opacity:var(--voice-cancel-progress);transform:scale(calc(.8 + var(--voice-cancel-progress) * .2))}
.ct-compose[data-voice-cancelled=true] .ct-voice-trash{visibility:visible;opacity:1;transform:none}
.ct-compose[data-voice-cancelled=true]>#ct-attach{visibility:hidden}
.ct-voice-timer{font-variant-numeric:tabular-nums;font-size:14px;flex:none}.ct-voice-hint{font-size:12px;color:var(--ct-muted);overflow:hidden;text-overflow:ellipsis}.ct-voice-dot{width:8px;height:8px;border-radius:50%;background:#f04b55;flex:none}
.ct-compose[data-recording=held] .ct-voice-hint::before{content:'‹';font-size:19px;vertical-align:-1px;margin-right:4px}
.ct-voice-cancel{border:0;background:transparent;color:var(--ct-accent);padding:0 8px;min-height:36px;margin:0 auto;font-size:14px;cursor:pointer;white-space:nowrap}
.ct-voice-lock,.ct-voice-pause{position:absolute;right:calc(var(--ct-voice-center-right) - 16px);bottom:calc(var(--ct-voice-center-bottom) + 40px);z-index:3;border:1px solid #cfdfef33;border-radius:32px;background:#7d98b370;color:#fff}.ct-voice-lock{width:32px;height:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;transform:translateY(calc(var(--voice-lock-progress,0) * 8px)) scale(calc(1 - var(--voice-lock-progress,0) * .25));opacity:calc(1 - var(--voice-lock-progress,0) * .35)}.ct-voice-lock svg{width:20px;height:20px}.ct-voice-lock>span:last-child svg{width:16px;height:16px}.ct-voice-pause{right:calc(var(--ct-voice-center-right) - 18px);bottom:calc(var(--ct-voice-center-bottom) + 52px);width:36px;height:36px;padding:8px;background:#a9bbcdce;color:#182032;border-radius:50%}
.ct-compose:not([data-recording=idle]) .ct-input-wrap textarea,.ct-compose:not([data-recording=idle])>#ct-attach,.ct-compose:not([data-recording=idle]) #ct-send{visibility:hidden}
.ct-compose:not([data-recording=idle]) .ct-voice-button{transition:none}
/* Follow the existing left-drag progress; reversing the gesture restores gold. */
.ct-compose[data-recording=held]{--ct-voice-r:calc(255 - 15 * var(--voice-cancel-progress,0));--ct-voice-g:calc(210 - 135 * var(--voice-cancel-progress,0));--ct-voice-b:calc(120 - 35 * var(--voice-cancel-progress,0));--ct-voice-fill:rgb(var(--ct-voice-r),var(--ct-voice-g),var(--ct-voice-b));--ct-voice-wave-fill:rgba(var(--ct-voice-r),var(--ct-voice-g),var(--ct-voice-b),.302);--ct-voice-wave-line:rgba(var(--ct-voice-r),var(--ct-voice-g),var(--ct-voice-b),.4);--ct-voice-wave-soft:rgba(var(--ct-voice-r),var(--ct-voice-g),var(--ct-voice-b),.2);--ct-voice-wave-soft-line:rgba(var(--ct-voice-r),var(--ct-voice-g),var(--ct-voice-b),.2)}
.ct-compose:is([data-recording=held],[data-recording=locked],[data-recording=paused],[data-recording=confirm],[data-recording=review],[data-recording=confirm-review],[data-recording=retry]) .ct-voice-button{color:white;border-color:transparent;background:transparent;transform:translate(var(--voice-drag-x,0px),var(--voice-drag-y,0px))}
.ct-compose:is([data-recording=held],[data-recording=locked],[data-recording=paused],[data-recording=confirm],[data-recording=review],[data-recording=confirm-review],[data-recording=retry]) .ct-voice-button::before{inset:-10px;background:var(--ct-voice-fill);border:2px solid #ffffff55;transform:scale(1)}
.ct-compose:is([data-recording=paused],[data-recording=confirm],[data-recording=review],[data-recording=confirm-review],[data-recording=retry]) .ct-voice-dot{background:#8096aa}
.ct-voice-confirm h2{margin:0 0 16px}.ct-voice-confirm footer{gap:18px;justify-content:center;align-items:center}.ct-voice-discard{background:#f04b55;color:white}.ct-voice-confirm button{box-sizing:border-box;height:48px;min-height:48px;padding:0 16px;font-size:14px;line-height:20px;white-space:nowrap}
@media(prefers-reduced-motion:no-preference){.ct-voice-button::before{transition:inset var(--ct-motion-time) var(--ct-motion-spring),transform var(--ct-motion-time) var(--ct-motion-spring),background var(--ct-motion-time) var(--ct-motion-ease)}.ct-compose:is([data-recording=held],[data-recording=locked]) .ct-voice-dot{animation:ct-record-pulse 1s ease-in-out infinite alternate}@keyframes ct-record-pulse{to{opacity:.4}}}
@media(max-width:600px){.ct-compose{--ct-voice-center-right:56px;--ct-attach-space:47px}.ct-voice-bar{padding:0 8px;gap:6px}.ct-voice-hint{font-size:10px}.ct-voice-timer{font-size:12px}.ct-voice-trash{left:6px}}

.ct-audio{width:290px;max-width:100%;display:grid;grid-template-columns:52px minmax(80px,1fr);grid-template-rows:30px 20px;column-gap:12px;align-items:center;white-space:nowrap}
.ct-audio-play{grid-row:1 / 3;width:52px;height:52px;border:0;border-radius:50%;padding:2px;background:var(--ct-accent);color:#171d30;display:grid;place-items:center;cursor:pointer}
.ct-audio-play svg{display:block;width:48px;height:48px;overflow:visible}.ct-audio-symbol-play{fill:currentColor;stroke:none}.ct-audio-symbol-line{fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.ct-audio-symbol-pause{fill:none;stroke:currentColor;stroke-width:4;stroke-linecap:round}
.ct-audio-ring-track,.ct-audio-ring{fill:none;stroke:currentColor;stroke-width:2.4}.ct-audio-ring-track{opacity:.2}.ct-audio-ring{transform:rotate(-90deg);transform-origin:24px 24px}
.ct-audio-track{position:relative;min-width:0;height:30px;grid-column:2}.ct-audio-waveform{height:30px;width:100%}.ct-audio-waveform:empty{background:radial-gradient(circle at center,#b6bdca 1.25px,transparent 1.5px) left bottom / 6px 4px repeat-x}
.ct-audio-retry{grid-column:1 / -1;grid-row:3;justify-self:start;min-height:44px;max-width:calc(100% - 56px);padding:0 6px;border:0;background:transparent;color:var(--ct-accent);font:inherit;cursor:pointer}
.ct-audio-seek{position:absolute;inset:0;width:100%;height:100%;opacity:0;margin:0;cursor:pointer;min-width:0}.ct-audio-track:focus-within{outline:2px solid var(--ct-accent);outline-offset:3px;border-radius:4px}.ct-audio-time{grid-column:2;font-size:13px;color:#b6bdca;font-variant-numeric:tabular-nums;padding-right:55px}
.ct-bubble--audio{position:relative;min-width:min(314px,76vw);padding:12px}.ct-bubble--audio .ct-message-meta{position:absolute;right:12px;bottom:12px;margin:0}
.ct-audio[data-audio-state=download] .ct-audio-play{background:#ffd2781c;border:1px solid #ffd27855;color:var(--ct-accent)}
@media(prefers-reduced-motion:reduce){.ct-audio-ring{transition:none}}

/* The locked send target matches the visible 64px circle without moving its centre. */
.ct-compose:is([data-recording=locked],[data-recording=paused],[data-recording=confirm],[data-recording=review],[data-recording=confirm-review],[data-recording=retry]) .ct-voice-button{width:64px;height:64px;margin:0;right:calc(var(--ct-voice-center-right) - 32px);bottom:calc(var(--ct-voice-center-bottom) - 32px)}
.ct-compose:is([data-recording=locked],[data-recording=paused],[data-recording=confirm],[data-recording=review],[data-recording=confirm-review],[data-recording=retry]) .ct-voice-button::before{inset:0}

.ct-voice-waves{position:absolute;right:calc(var(--ct-voice-center-right) - 32px);bottom:calc(var(--ct-voice-center-bottom) - 32px);width:64px;height:64px;pointer-events:none;z-index:2;display:none;transform:translate(var(--voice-drag-x,0px),var(--voice-drag-y,0px));--voice-amplitude:calc(var(--voice-level,0) * .04)}
.ct-compose:is([data-recording=held],[data-recording=locked]) .ct-voice-waves{display:block}
.ct-voice-wave{position:absolute;inset:-7px;background:var(--ct-voice-wave-fill);border:1px solid var(--ct-voice-wave-line);border-radius:48% 52% 53% 47% / 49% 46% 54% 51%;box-shadow:none}
.ct-voice-wave:nth-child(2){inset:-11px;background:var(--ct-voice-wave-soft);border-color:var(--ct-voice-wave-soft-line);box-shadow:none;border-radius:53% 47% 46% 54% / 48% 54% 46% 52%}
.ct-voice-button{z-index:3}.ct-voice-button::after{display:none}

@media(prefers-reduced-motion:no-preference){
 .ct-input-wrap{transition:margin-right var(--ct-motion-time) var(--ct-motion-ease)}
 .ct-compose[data-recording=idle] .ct-voice-button,.ct-compose #ct-send{transition:opacity var(--ct-motion-time) var(--ct-motion-ease),visibility var(--ct-motion-time)}
 .ct-voice-button svg,.ct-compose #ct-send svg{transition:transform var(--ct-motion-time) var(--ct-motion-spring),opacity var(--ct-motion-time) var(--ct-motion-ease)}
 .ct-voice-trash{transition:opacity var(--ct-motion-time) var(--ct-motion-ease),transform var(--ct-motion-time) var(--ct-motion-spring),visibility var(--ct-motion-time)}
 .ct-compose[data-voice-cancelled=true] .ct-voice-trash{animation:ct-voice-discard var(--ct-motion-time) var(--ct-motion-ease) both}
 .ct-voice-bar{transition:left var(--ct-motion-time) var(--ct-motion-ease)}
 .ct-voice-wave{animation:ct-voice-jelly 3.6s ease-in-out infinite alternate;transition:background var(--ct-motion-time) var(--ct-motion-ease),border-color var(--ct-motion-time) var(--ct-motion-ease)}
 .ct-voice-wave:nth-child(2){animation:ct-voice-jelly-other 4.6s ease-in-out -1.4s infinite alternate}
 .ct-compose[data-recording=held] .ct-voice-lock>span:first-child{animation:ct-lock-sway 3.2s ease-in-out infinite}
 .ct-compose[data-recording=held] .ct-lock-shackle{transform-box:fill-box;transform-origin:left bottom;animation:ct-lock-breathe 3.2s ease-in-out infinite}
 @keyframes ct-voice-jelly{0%{transform:rotate(-8deg) scale(calc(.96 + var(--voice-amplitude)));border-radius:48% 52% 53% 47% / 49% 46% 54% 51%}100%{transform:rotate(12deg) scale(calc(1.07 + var(--voice-amplitude)));border-radius:53% 47% 48% 52% / 46% 54% 49% 51%}}
 @keyframes ct-voice-jelly-other{0%{transform:rotate(11deg) scale(calc(1.02 + var(--voice-amplitude)));border-radius:53% 47% 46% 54% / 48% 54% 46% 52%}100%{transform:rotate(-13deg) scale(calc(.95 + var(--voice-amplitude)));border-radius:47% 53% 54% 46% / 53% 46% 54% 47%}}
 @keyframes ct-lock-sway{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-2px) rotate(3deg)}}
 @keyframes ct-lock-breathe{0%,20%,100%{transform:rotate(0deg) translateY(0)}50%,65%{transform:rotate(-11deg) translateY(-.5px)}}
 @keyframes ct-voice-discard{0%{opacity:.7;transform:scale(.88)}28%{opacity:1;transform:scale(1.12) rotate(-5deg)}55%{opacity:1;transform:scale(1) rotate(3deg)}72%{opacity:.9;transform:scale(1)}100%{opacity:0;transform:translateY(6px) scale(.8)}}
}

.ct-voice-confirm button:focus-visible{outline:2px solid var(--ct-accent);outline-offset:-3px}
