/* R24 corrective CSS. Canonical data and shared components; historical VK 2017 widths. */
#appframe>.screen[data-aw-chat-id] .chat{padding:10px 10px 8px!important;overflow-x:clip!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb{display:flow-root!important;box-sizing:border-box!important;position:relative!important;clear:both!important;float:none!important;width:max-content!important;max-width:min(80%,390px)!important;min-width:65px!important;min-height:0!important;height:auto!important;max-height:none!important;margin:3px 0 5px!important;padding:0 0 16px!important;border:0!important;box-shadow:none!important;overflow:visible!important;text-align:left!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.out{margin-left:auto!important;margin-right:0!important;background:#d5e3f5!important;border-radius:17px 17px 4px 17px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.in{margin-right:auto!important;margin-left:0!important;background:#ebedf0!important;border-radius:17px 17px 17px 4px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb>.bb-t{display:block!important;width:auto!important;height:auto!important;min-height:0!important;border:0!important;background:transparent!important;padding:8px 11px 0!important;margin:0!important;font:15px/19px -apple-system,BlinkMacSystemFont,sans-serif!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;text-align:left!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb>.bb-t:empty{display:none!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb>.bb-tm{position:absolute!important;z-index:2!important;right:9px!important;bottom:3px!important;display:block!important;margin:0!important;padding:0!important;font:11px/12px -apple-system,sans-serif!important;color:#8998a7!important;white-space:nowrap!important;pointer-events:none!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.out:has(>.aw-read-ticks)>.bb-tm{right:30px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb>.aw-read-ticks{position:absolute!important;right:5px!important;bottom:3px!important;display:flex!important;width:22px!important;height:13px!important;align-items:center!important;margin:0!important;padding:0!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb>.aw-read-ticks svg{display:block!important;stroke:#7098bd!important;stroke-linecap:round!important;stroke-linejoin:round!important;stroke-width:1.5!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-vc{width:min(76vw,315px)!important;min-width:0!important;max-width:80%!important;padding-bottom:16px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-vc>.bb-voice{box-sizing:border-box!important;display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:41px!important;padding:5px 9px 1px!important;border:0!important;border-radius:inherit!important;background:transparent!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-vc .bb-vp{display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 30px!important;height:30px!important;width:30px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-vc .bb-wave{min-width:0!important;flex:1 1 auto!important;justify-content:space-around!important;gap:2px!important;overflow:hidden!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-vc .bb-vd{font-size:11px!important;white-space:nowrap!important;max-width:42px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-ph{min-width:0!important;max-width:min(80%,360px)!important;padding-bottom:18px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-ph>.bb-photo{box-sizing:border-box!important;display:block!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:440px!important;min-width:120px!important;min-height:55px!important;border-radius:inherit!important;overflow:hidden!important;margin:0!important;background:transparent!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-ph>.bb-photo img,#appframe>.screen[data-aw-chat-id] .chat>.bb.bb-ph>.bb-photo video{display:block!important;width:auto!important;max-width:min(100%,320px)!important;height:auto!important;max-height:390px!important;min-width:120px!important;object-fit:contain!important;aspect-ratio:auto!important;margin:0!important;border-radius:inherit!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message{width:max-content!important;max-width:min(84%,405px)!important;min-width:150px!important;padding:0 0 18px!important;background:#d5e3f5!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message>.bb-t{padding:9px 12px 0!important;white-space:normal!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-group{width:100%!important;padding:0 0 0 9px!important;margin:0!important;border-left:2px solid #6c99c7!important;background:transparent!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-head,#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-origin{display:none!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-item{position:relative!important;box-sizing:border-box!important;display:flow-root!important;max-width:100%!important;min-height:0!important;margin:0 0 5px!important;padding:2px 0 13px!important;border:0!important;background:none!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-item+.vk-forwarded-item{padding-top:4px!important;border-top:0!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-avatar{float:left!important;width:25px!important;height:25px!important;border-radius:50%!important;object-fit:cover!important;margin:0 7px 3px 0!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-sender{font-size:13px!important;font-weight:600!important;line-height:17px!important;color:#5181b8!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-text{font-size:15px!important;line-height:19px!important;color:#14171a!important;white-space:pre-wrap!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-time{position:absolute!important;right:2px!important;bottom:0!important;font:11px/12px -apple-system,sans-serif!important;color:#8998a7!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-attachment{margin:3px 0!important;max-width:100%!important;overflow:hidden!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-attachment img,#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-attachment video{width:auto!important;max-width:min(100%,265px)!important;height:auto!important;max-height:240px!important;object-fit:contain!important;border-radius:5px!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message .vk-forwarded-voice{width:100%!important;min-height:36px!important;background:transparent!important;padding:4px 0!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb .vk-message-reply{box-sizing:border-box!important;display:block!important;width:100%!important;border:0!important;border-left:2px solid #6b9dca!important;border-radius:0!important;padding:2px 0 3px 8px!important;background:transparent!important;color:#1d1d1d!important;white-space:normal!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb .vk-message-reply strong{display:block!important;font-size:13px!important;color:#5181b8!important}
#appframe>.screen[data-aw-chat-id] .chat>.bb .vk-message-reply span{display:block!important;font-size:13px!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
/* Editor panels occupy their own viewport-safe rows and never slip behind the bottom tab bar. */
#appframe .ctor-runtime,#appframe .vk-editor-tools,#appframe .aw-chat-message-tools{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;overflow:visible!important;padding:8px!important;gap:6px!important}
#appframe .aw-chat-message-tools{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr))!important}
#appframe .aw-chat-message-tools>button{box-sizing:border-box!important;width:100%!important;min-width:0!important;margin:0!important;white-space:normal!important}
#appframe .aw-chat-composer{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important}
#appframe .aw-chat-composer>button{flex:0 0 auto!important;max-width:100%!important;min-height:34px!important;padding:6px 10px!important;margin:0!important;font-size:13px!important}
#appframe .aw-chat-composer label{min-width:0!important;margin:0!important;flex:0 1 auto!important}
#appframe .aw-chat-composer select{max-width:55vw!important}
#appframe .ctor-runtime button,#appframe .vk-editor-tools button{box-sizing:border-box!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.25!important}
.ctor-dialog .ctor-dialog-body,.ctor-dialog form,.ctor-dialog .ctor-actions,.ctor-dialog footer{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.ctor-dialog button{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}
.ctor-dialog footer{display:flex!important;gap:6px!important;flex-wrap:wrap!important}
.ctor-dialog footer button{flex:1 1 110px!important}
#cmodalBody.vk-unified-comment-list>.cm,.vk-video-comment-list.vk-unified-comment-list>.cm,.vk-entity-comment-modal .vk-unified-comment-list>.cm{margin:0!important;border:0!important;box-shadow:none!important;background:#fff!important;padding:9px 12px 5px!important}
#cmodalBody.vk-unified-comment-list>.cm.reply,.vk-video-comment-list.vk-unified-comment-list>.cm.reply{padding-left:52px!important}
.vk-unified-comment-list .cm .cm-mention{color:#5181b8!important;cursor:pointer!important}
.vk-unified-comment-list .cm .cm-f{min-width:0!important;max-width:100%!important;gap:10px!important;flex-wrap:wrap!important}
.vk-unified-comment-list .cm .cm-lk.is-liked,.vk-unified-comment-list .cm .cm-lk[aria-pressed=true]{color:#f04453!important}
/* Playlists use native hairline rows, comments do not. */
#appframe .tr{position:relative!important;border:0!important;background:#fff!important}
#appframe .tr:not(:last-child)::after{content:''!important;position:absolute!important;left:54px!important;right:0!important;bottom:0!important;height:1px!important;background:#e5e9ed!important;display:block!important}
#appframe .tr:not(:last-child){border-bottom:1px solid #e5e9ed!important}
/* Story controls: back arrow far left, three dots before close on right; like icon white until selected. */
body.story-open .stv-top .stv-x{margin-left:auto!important;order:99!important}
body.story-open .stv-top [data-story-menu],body.story-open .stv-top [onclick*=Menu],body.story-open .stv-top [onclick*=menu]{order:98!important}
body.story-open .stv-bot .like:not(.liked),body.story-open .stv-bot .like:not(.liked) svg{color:#fff!important;fill:#fff!important}
@media(max-width:390px){#appframe>.screen[data-aw-chat-id] .chat>.bb{max-width:84%!important}#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-forward-message{max-width:85%!important}}

/* Multiple attachments share ONE outgoing or incoming bubble and ONE time/receipt. */
#appframe>.screen[data-aw-chat-id] .chat>.bb.vk-chat-album-message{width:min(78%,350px)!important;min-width:0!important;max-width:84%!important}
#appframe>.screen[data-aw-chat-id] .bb-photo-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:2px!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;border-radius:14px 14px 4px 14px!important}
#appframe>.screen[data-aw-chat-id] .bb-photo-grid[data-count="1"]{grid-template-columns:1fr!important}
#appframe>.screen[data-aw-chat-id] .bb-photo-grid[data-count="3"]>:first-child{grid-row:span 2!important}
#appframe>.screen[data-aw-chat-id] .bb-photo-grid img,#appframe>.screen[data-aw-chat-id] .bb-photo-grid video{display:block!important;min-width:0!important;max-width:100%!important;width:100%!important;height:100%!important;aspect-ratio:1!important;object-fit:cover!important}
#appframe>.screen[data-aw-chat-id] .vk-forwarded-item .bb-photo-grid{width:min(100%,260px)!important}
#appframe>.screen[data-aw-relation-type="followers"] .r24-editor-dummy{display:block!important;width:calc(100% - 24px)!important;min-height:36px!important;border:0!important;border-radius:6px!important;margin:10px 12px!important;padding:9px 12px!important;background:#5181b8!important;color:white!important;font-size:13px!important}

/* R24: put story controls in same order as reference (menu, then close), at far right. */
body.story-open .stv-top .vk-story-manage{order:98!important;margin-left:auto!important;flex:0 0 36px!important;min-width:36px!important;width:36px!important}
body.story-open .stv-top .stv-x{order:99!important;margin-left:4px!important;flex:0 0 32px!important;min-width:32px!important}
