/* Compact reading bubbles; touch controls retain their own hit areas. */
.message{-webkit-touch-callout:none;position:relative;width:fit-content;max-width:min(85%,460px);padding:10px 13px!important;margin-bottom:9px!important;font-size:14px;line-height:1.45}.message-body{font-size:14px;line-height:1.45;white-space:normal;padding-right:18px}.message-body:empty{display:none}.message-heading{min-height:21px;margin-bottom:5px;gap:8px}.message-author-button{font-size:11px;gap:5px}.message-author-button .avatar{width:19px;height:19px;flex-basis:19px;font-size:8px}.message small.message-meta,.message>small{font-size:10px;line-height:14px;margin-top:5px;text-align:right;display:block}.message .content-more{width:30px;min-width:30px;height:29px;padding:5px;opacity:.65}.message .content-more svg{width:17px;height:17px}.message.mine .message-author-button,.message.private-message .message-author-button{display:none}.message.mine .message-heading,.message.private-message .message-heading{position:absolute;right:5px;top:4px;margin:0;min-height:0}.message.mine:has(.voice-message),.message.private-message:has(.voice-message){padding-top:14px!important}.message-status{display:inline-flex;align-items:center;gap:2px;vertical-align:middle}.message-status svg{width:17px;height:17px}.message-status .status-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.message:has(.voice-message){width:fit-content;min-width:0;max-width:min(90%,310px);padding:8px 11px!important}.message .voice-message{width:244px;gap:7px;padding:2px 0}.message .voice-track{height:40px}.message .voice-wave{height:27px}.message .voice-wave i{height:calc(var(--bar)*.76)}.message .voice-play{width:39px;height:39px;min-width:39px}.message .voice-play svg{width:19px;height:19px}.message .voice-speed{width:31px;height:40px;font-size:11px}.message .voice-time{font-size:10px!important;line-height:13px!important}.message .voice-track input{height:29px;inset:0 0 11px}.message .voice-track:before{bottom:12px}.message:has(.media-deck){max-width:min(91%,350px)}
.media-deck{position:relative;isolation:isolate;width:225px;height:167px;max-width:100%;margin:5px 8px 5px 0;touch-action:pan-y;--drag:0px}.media-card{position:absolute;left:35px;top:9px;width:148px;height:135px;padding:0;overflow:hidden;border-radius:14px;border:2px solid #ffffffdd;background:#dce6f3;box-shadow:0 5px 11px #34497025;transform:translateX(calc(var(--card-x) + var(--drag))) rotate(var(--card-angle));z-index:var(--card-z);opacity:var(--card-opacity);pointer-events:var(--card-pointer);transition:transform .28s cubic-bezier(.22,.8,.25,1),opacity .2s;cursor:pointer;-webkit-touch-callout:none}.media-card img,.media-card video{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none;user-select:none;-webkit-user-drag:none}.media-deck.single{height:148px;width:191px}.media-deck.single .media-card{left:0;width:185px;height:139px;border-width:1px;transform:none}.media-deck.single .media-count{display:none}.media-count{position:absolute;left:88px;bottom:0;color:var(--secondary-ink,#6c7c98);font-size:10px;line-height:16px}.media-all{position:absolute;right:0;bottom:-2px;display:flex;align-items:center;gap:3px;padding:3px 5px;color:var(--brand,#5366d9);font-size:10px;border-radius:8px;z-index:5}.media-all svg{width:14px;height:14px}.media-video-mark{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:35px;height:35px;display:grid;place-items:center;border-radius:50%;color:white;background:#17253b77;backdrop-filter:blur(6px);pointer-events:none}.media-video-mark svg{width:20px;height:20px}.chat-file-list{display:grid;gap:6px;margin-top:6px;width:260px;max-width:100%}.chat-file-row{display:flex;align-items:center;gap:9px;min-height:48px;padding:8px 10px;border-radius:13px;background:#819bd514;border:1px solid #91a3c41a;text-decoration:none;color:inherit;min-width:0}.chat-file-row>svg{width:22px;height:22px;color:var(--brand,#637dd0);flex:none}.chat-file-row>svg:last-child{width:14px}.chat-file-row>span{flex:1;min-width:0}.chat-file-row strong{display:block;font-size:12px;font-weight:600;overflow-wrap:anywhere;line-height:1.35}.chat-file-row small{display:block;text-align:left!important;margin-top:2px!important;font-size:10px!important;color:var(--secondary-ink,#7483a1)}
.media-gallery-dialog{width:min(850px,calc(100% - 20px))}.media-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.media-gallery-grid button{position:relative;aspect-ratio:1;padding:0;overflow:hidden;background:#879abd20;border-radius:16px}.media-gallery-grid img,.media-gallery-grid video,.media-thumbnails img,.media-thumbnails video{display:block;object-fit:cover;width:100%;height:100%;pointer-events:none}.media-gallery-grid button>span:not(.media-video-mark){position:absolute;bottom:6px;left:7px;border-radius:8px;padding:3px 7px;color:white;background:#14223e80;font-size:11px}.media-large{display:block;width:100%;height:min(55dvh,500px);object-fit:contain;border-radius:14px;background:#17213b0a}.media-viewer-nav{display:flex;align-items:center;justify-content:center;gap:20px;margin:12px 0;font-size:12px}.media-viewer-nav button{min-width:44px;min-height:44px;display:grid;place-items:center}.media-thumbnails{display:flex;gap:7px;overflow-x:auto;padding:5px 3px;scroll-snap-type:x mandatory}.media-thumbnails button{position:relative;width:54px;height:54px;flex:none;padding:0;overflow:hidden;border-radius:10px;scroll-snap-align:center;border:2px solid transparent}.media-thumbnails .selected{border-color:var(--brand,#637dd0)}.media-thumbnails .media-video-mark{width:22px;height:22px}.media-thumbnails .media-video-mark svg{width:13px;height:13px}.media-viewer-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px}.media-draft-items{display:flex;gap:7px;overflow:auto;padding:4px 0;max-width:100%}.media-draft-item{position:relative;width:68px;min-width:68px;height:68px;background:#8096c51c;border-radius:12px;overflow:hidden}.media-draft-item img,.media-draft-item video{width:100%;height:100%;object-fit:cover}.media-draft-item>button{position:absolute;right:2px;top:2px;width:27px;height:27px;display:grid;place-items:center;background:#ffffffeb;border-radius:50%;color:#485f86;padding:5px}.media-draft-item svg{width:16px;height:16px}.media-draft-file{display:flex;align-items:center;justify-content:center;height:100%;font-size:9px;padding:12px 5px 4px;overflow-wrap:anywhere}.upload-file-list{display:grid;gap:8px}.upload-file-row{padding:9px 11px;border-radius:12px;background:#839ad313;overflow-wrap:anywhere;font-size:12px}.upload-file-row small{display:block;color:var(--muted)}.upload-file-row progress{width:100%}.upload-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.search-result-button{display:block;width:100%;text-align:left;color:inherit;cursor:pointer;border:1px solid var(--line);border-radius:15px;background:var(--surface,#ffffff9c);padding:14px;margin-top:9px}.search-result-button:hover{background:#8aa5ef16}.search-result-button small{display:block;color:var(--muted);margin:6px 0;font-size:11px}.search-result-button p{margin:0;line-height:1.5;font-size:13px}.message-enter{animation:chat-message-enter .2s ease-out}.receipt-updated svg{animation:chat-tick .32s ease-out}.search-hit-highlight{animation:chat-search-hit 2s ease-out}
@keyframes chat-message-enter{from{opacity:.35;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes chat-tick{0%{opacity:.3;transform:scale(.75)}65%{opacity:1;transform:scale(1.12)}100%{transform:scale(1)}}@keyframes chat-search-hit{0%,25%{box-shadow:0 0 0 3px #7799f1,0 0 25px #7799f144}100%{box-shadow:none}}
@media(max-width:760px){.message{font-size:14px;max-width:89%;padding:9px 11px!important}.message .voice-message{width:217px}.message:has(.voice-message){max-width:90%}.message .voice-play{width:37px;height:37px;min-width:37px}.message .voice-speed{width:29px}.media-deck{width:211px;height:156px}.media-card{left:33px;width:141px;height:126px}.media-deck.single{width:180px;height:138px}.media-deck.single .media-card{width:175px;height:132px}.media-count{left:80px}.chat-file-list{width:225px}.media-gallery-grid{gap:6px}.media-gallery-dialog .dialog-body{padding:14px}.media-large{height:44dvh}}
@media(prefers-reduced-motion:reduce){.media-card{transition:none}.message-enter,.receipt-updated svg,.search-hit-highlight{animation:none}}

/* Direct manipulation while dragging; only the settling motion is eased. */
.media-card{transform:translate3d(var(--card-x),var(--card-y,0px),0) rotate(var(--card-angle)) scale(var(--card-scale,1));transform-origin:50% 85%;backface-visibility:hidden}
.media-deck.dragging .media-card{transition:none;will-change:transform}
.media-deck{overflow:clip;overflow-clip-margin:12px}
.media-count{z-index:105;pointer-events:none}.media-all{z-index:106}
.media-viewer .media-stage{height:min(55dvh,500px);display:grid;place-items:center;overflow:hidden}
.media-stage .media-large{height:100%}
.private-header{flex-wrap:nowrap;gap:10px}
.private-header .channel-identity{flex:1 1 0;min-width:0;flex-basis:0}
.private-header .contact-identity{display:grid;grid-template-columns:42px minmax(0,1fr);flex:1 1 0;min-width:0;max-width:100%;gap:10px;padding:2px}
.private-header .contact-identity>.avatar{display:grid;place-items:center;line-height:1;font-size:13px;font-weight:700;width:42px;height:42px;min-width:42px;max-width:42px;border-radius:50%;overflow:hidden;aspect-ratio:1;align-self:center}
.private-header .contact-identity>.avatar img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.private-header .contact-identity>div{min-width:0;overflow:hidden}
.private-header .contact-identity h2{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.private-header .contact-identity .sub{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.private-header .header-actions{flex:0 0 auto}
.private-header .back{flex-shrink:0}
@media(max-width:760px){.private-header{gap:4px;padding:10px 8px}.private-header .channel-identity{gap:5px}.private-header .contact-identity{grid-template-columns:38px minmax(0,1fr);gap:8px}.private-header .contact-identity>.avatar{width:38px;height:38px;min-width:38px;max-width:38px}.private-header .back{width:38px;min-width:38px;margin-right:0}.media-viewer .media-stage{height:44dvh}}

.chat-initial-sync{display:grid;gap:10px;padding:10px 0;opacity:.38;pointer-events:none;width:min(70%,280px)}.chat-initial-sync i{display:block;height:32px;background:var(--line,#9baed329);border-radius:14px}.chat-initial-sync i:nth-child(2){width:65%;margin-left:28px}.chat-initial-sync i:nth-child(3){width:82%}
