/* Conversation spacing, media and document cards based on the approved reference. */
html body .app #messages{gap:4px!important;padding:10px 12px!important;scroll-padding-bottom:20px}
html body .app #messages>.message{box-sizing:border-box;width:fit-content;max-width:min(86%,620px);margin-top:0!important;margin-bottom:2px!important;padding:9px 11px 5px!important;border:0!important;border-radius:17px!important;box-shadow:none!important}
html body .app #messages>.message.mine{border-bottom-right-radius:5px!important}
html body .app #messages>.message:not(.mine){border-bottom-left-radius:5px!important}
html body .app #messages .message-text{font-size:15px;line-height:1.4;margin:0 0 3px;overflow-wrap:anywhere}
html body .app #messages .message-author{font-size:12px;line-height:1.3;margin:0 0 5px;font-weight:600}
html body .app #messages .message-meta{font-size:10px;line-height:1.25;gap:4px;min-height:20px;justify-content:flex-end;align-items:center;margin:2px 0 0;opacity:.8}
html body .app #messages .attachment-share-actions{display:none!important}
html body .app #messages .media-placeholder{padding:1px 0!important;gap:11px;align-items:center;background:transparent!important}
html body .app #messages .media-placeholder>span:not(.pdf-file-icon){font-size:14px;line-height:1.35;min-width:0;overflow-wrap:anywhere}
html body .app #messages .media-placeholder small{font-size:11px;margin-top:3px;opacity:.65}
html body .app #messages .document-file-name{font-size:14px;line-height:1.35;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%}
html body .app #messages .document-file-size{font-size:11px;opacity:.65}
html body .app #messages .pdf-file-icon{flex:0 0 35px;width:35px;height:42px;border-radius:8px;margin:0 5px 0 2px}
html body .app #messages .document-type-badge{font-size:9px;padding:3px 0;bottom:5px}
html body .app #messages .document-download-arrow{width:13px;height:15px;left:11px;top:5px}
html body .app #messages .media-slot.pdf-attachment .media-content>a[download]{gap:10px;padding:1px 0;font-size:14px}
html body .app #messages>.message:has(.image-open){padding:2px!important;max-width:min(90%,620px);overflow:hidden;position:relative}
html body .app #messages .image-open{max-width:100%;width:100%;border-radius:15px;overflow:hidden}
html body .app #messages .image-open img{display:block;width:auto;max-width:100%;height:auto;max-height:520px;object-fit:contain}
html body .app #messages>.message:has(.image-open):not(:has(.message-text)):not(.selection-mode) .message-meta{position:absolute;right:7px;bottom:7px;margin:0!important;padding:3px 7px!important;border-radius:13px;background:#0006;color:#fff!important;opacity:1;min-height:18px;z-index:2}
html body .app #messages>.message:has(.image-open) .message-author{margin:5px 8px!important}
html body .app #messages .message-meta .message-menu-toggle{flex-basis:24px;width:24px!important;min-width:24px!important;height:22px!important;min-height:22px!important;padding:3px!important;margin-left:1px!important;opacity:.65!important}
html body .app #messages>.message.selection-mode{padding-left:34px!important}
html[data-theme=dark] body .app #messages>.message{background:#36394d!important;color:#f5f5fa!important}
html[data-theme=dark] body .app #messages>.message.mine{background:linear-gradient(110deg,#6468e9,#924ab0)!important;color:#fff!important}
html[data-theme=dark] body .app #messages{background-color:transparent!important}
html[data-theme=dark] body .app .conversation:not([data-wallpaper]),html[data-theme=dark] body .app .conversation[data-wallpaper=etvel]{background-color:#111215!important;background-image:url("/etvel-chat-pattern.svg")!important;background-size:320px 320px!important}
html[data-theme=dark] body .app .conversation-header,html[data-theme=dark] body .app .composer-area{background:#1b1c20!important;border-color:#292b34!important}
@media(max-width:680px){html body .app #messages{padding:7px 6px!important;gap:3px!important}html body .app #messages>.message{max-width:89%;border-radius:16px!important}html body .app #messages .message-text{font-size:16px}html body .app #messages .image-open img{max-height:62dvh}html body .app #messages>.message:has(.image-open){max-width:94%}html body .app #messages .document-file-name{max-width:65vw}html body .app #messages .message-meta{font-size:10px}html body .app #messages .message-meta .message-menu-toggle{min-width:28px!important;width:28px!important;min-height:26px!important;height:26px!important}}

/* Keep media messages measurable while images decode. */
html body .app #messages>.message{flex-shrink:0}
html body .app #messages .media-slot:has(.image-open){min-width:min(320px,60vw)}
html body .app #messages .image-open{min-height:48px}
