/* Media belongs to the conversation, without a second card or file metadata. */
.conversation-stream .chat-entry.media-entry { padding: 3px; border: 0; box-shadow: 0 1px 1px #18241c15; max-width: min(88%, 330px); }
.conversation-stream .media-gallery { display: contents; }
.conversation-stream .media-item.chat-media { margin: 0; padding: 0; background: transparent; border: 0; border-radius: 8px; overflow: hidden; min-width: 0; }
.conversation-stream .chat-media figcaption { margin: 0; padding: 0; display: block; }
.chat-media-sender { display: block; padding: 4px 7px 5px; font-size: 12px; font-weight: 650; color: #118165; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-stream .chat-media.is-own figcaption:empty { display: none; }
.chat-visual-open { display: block; position: relative; width: 100%; padding: 0; border: 0; border-radius: 7px; min-height: 120px; background: #dfe5da; overflow: hidden; line-height: 0; }
.conversation-stream .chat-visual img, .conversation-stream .chat-visual video { display: block; width: 100%; height: auto; max-height: 330px; min-height: 120px; object-fit: cover; border: 0; border-radius: 7px; margin: 0; background: #26342e; }
.conversation-stream .chat-visual video { aspect-ratio: 4 / 3; object-fit: contain; pointer-events: none; }
.conversation-stream .chat-image-time { position: absolute; right: 7px; bottom: 6px; padding: 4px 6px; background: #19221b80; color: #fff; border-radius: 8px; font-size: 10px; font-weight: 400; line-height: 1; }
.chat-video-play { display: grid; place-items: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; width: 48px; height: 48px; border-radius: 50%; background: #0a171a80; border: 1px solid #ffffff80; }
.chat-video-duration, .chat-room-clip { position: absolute; left: 8px; bottom: 8px; color: #fff; font-size: 11px; line-height: 1.2; font-weight: 500; text-shadow: 0 1px 4px #000; }
.chat-room-clip { top: 9px; bottom: auto; background: #15251e99; padding: 4px 6px; border-radius: 6px; font-size: 10px; }
.conversation-stream .media-entry:has(.chat-voice) { width: min(88%, 330px); padding: 4px 6px 2px; overflow: visible; }
.conversation-stream .media-item.chat-voice { overflow: visible; }
.conversation-stream .chat-voice audio { display: none; }
.chat-voice-line { display: grid; grid-template-columns: 48px minmax(0, 1fr) 37px; gap: 6px; align-items: center; }
.chat-voice-play { display: grid; place-items: center; min-height: 48px; width: 48px; border: 0; padding: 0; color: #536d61; background: none; border-radius: 50%; }
.chat-voice-play svg { width: 30px; height: 30px; }
.chat-voice-play[aria-busy=true] { opacity: .55; }
.voice-is-playing .chat-voice-play { color: #007d65; }
.chat-voice-track { min-width: 0; padding-top: 3px; }
.chat-voice input[type=range] { --voice-progress: 0%; display: block; appearance: none; width: 100%; min-height: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; accent-color: #0c9d83; }
.chat-voice input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(to right,#0c9d83 var(--voice-progress),#a6b8a9 var(--voice-progress)); }
.chat-voice input[type=range]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 0; border-radius: 50%; background: #0c9d83; }
.chat-voice input[type=range]::-moz-range-track { height: 3px; background: #a6b8a9; border-radius: 4px; }
.chat-voice input[type=range]::-moz-range-progress { height: 3px; background: #0c9d83; }
.chat-voice input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #0c9d83; }
.chat-voice input[type=range]:disabled { opacity: .5; cursor: default; }
.chat-voice-meta { display: flex; align-items: center; justify-content: space-between; gap: 5px; height: 22px; color: #667c6a; font-size: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.chat-voice-speed { min-height: 48px; min-width: 48px; height: 48px; margin: -13px -6px -13px 0; border: 0; padding: 0; border-radius: 20px; color: #537261; background: none; font-size: 11px; font-weight: 650; }
.chat-voice-avatar { position: relative; display: grid; place-items: center; height: 35px; width: 35px; border-radius: 50%; background: #c0d9c0; color: #2b6655; font-size: 13px; font-weight: 600; }
.chat-voice-avatar>span { position: absolute; right: -3px; bottom: -4px; color: #0e9d7a; background: #e1f2d6; border-radius: 8px; padding: 1px; line-height: 0; }
.chat-voice-footer { position: relative; display: flex; justify-content: flex-end; align-items: center; gap: 3px; padding: 0 3px 0 44px; min-height: 19px; }
.conversation-stream .chat-voice-footer time { color: #6b7d6e; font-size: 10px; line-height: 1; white-space: nowrap; }
.chat-voice-error { font-size: 11px; color: #9c3529; line-height: 1.35; margin-right: auto; }
.chat-media-menu { position: relative; padding: 0; margin: -15px -6px -15px 0 !important; flex: 0 0 48px; }
.chat-media-menu summary { display: grid; place-items: center; height: 48px; min-height: 48px; width: 48px; font-size: 18px; letter-spacing: 1px; font-weight: 650; color: #647768; padding: 0; list-style: none; }
.chat-media-menu summary:before { display: none; }
.chat-media-menu summary::-webkit-details-marker { display: none; }
.chat-media-menu a { position: absolute; z-index: 8; right: 0; bottom: 33px; display: flex; align-items: center; min-height: 48px; min-width: 145px; padding: 10px 16px; border: 1px solid #d8e1d8; border-radius: 12px; background: #fff; box-shadow: 0 4px 20px #0002; color: #244a3b; font-size: 13px; text-decoration: none; white-space: nowrap; }
.chat-media-viewer { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #0c1519; color: #fff; overflow: hidden; }
.chat-media-viewer::backdrop { background: #0c1519; }
.chat-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
.chat-viewer-toolbar button,.chat-viewer-toolbar a { display: grid; place-items: center; flex: 0 0 48px; min-height: 48px; height: 48px; width: 48px; border: 0; background: transparent; color: #fff; padding: 0; border-radius: 50%; }
.chat-viewer-toolbar strong { flex: 1; min-width: 0; font-size: 15px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.chat-viewer-stage { display: grid; place-items: center; height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); position: relative; }
.chat-viewer-stage img,.chat-viewer-stage video { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.chat-viewer-stage p { position: absolute; bottom: 30px; background: #000b; padding: 12px 18px; border-radius: 12px; margin: 10px; font-size: 14px; }
@media(max-width:370px) { .chat-voice-line { grid-template-columns: 48px minmax(0,1fr) 32px; gap: 4px; } .chat-voice-avatar { width: 31px; height: 31px; } .chat-voice-play { width: 48px; } .conversation-stream .chat-entry.media-entry { max-width: 91%; } }
