.chat-conversation{position:relative}
.room-info-open>:not(.chat-room-screen){display:none!important}
.chat-room-screen{display:flex;flex-direction:column;position:absolute;inset:0;min-width:0;min-height:0;background:#fff;z-index:5;overflow:hidden;container-type:inline-size;animation:cr-enter .22s cubic-bezier(.16,1,.3,1)}
.cr-header{display:flex;align-items:center;gap:12px;padding:12px 20px;flex-shrink:0;border-bottom:1px solid var(--line);background:#fff}
.cr-header h2{flex:1;min-width:0;margin:0;font:600 23px/1.3 Oswald,sans-serif}
.cr-header .icon-button{width:44px;height:44px;padding:10px;flex:none}
.cr-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding:20px;flex:1}
.cr-content{max-width:820px;margin:auto;padding:28px 28px 24px;min-width:0}
.cr-identity{display:flex;align-items:center;gap:18px;min-width:0;margin-bottom:16px}
.cr-photo{position:relative;width:88px;height:88px;flex:0 0 88px;padding:0;border:0;border-radius:50%;background:#eee8fa}
.cr-photo>.avatar{width:88px;height:88px;min-width:88px;border-radius:50%;font-size:30px;overflow:hidden;display:flex;align-items:center;justify-content:center}
.cr-photo .avatar img{width:100%;height:100%;object-fit:cover}
.cr-photo>span:not(.avatar){position:absolute;bottom:-1px;right:-1px;display:grid;place-items:center;background:#e6dcf8;color:#403252;width:30px;height:30px;border-radius:50%;border:3px solid #fff;box-sizing:content-box}
.cr-photo>span:not(.avatar) svg{width:17px;height:17px}
.cr-name{min-width:0;flex:1}
.cr-name h3{margin:0 0 7px;font:650 22px/1.4 Manrope,sans-serif;overflow-wrap:anywhere}
.cr-name>span,.cr-hint{color:#62596c;font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.cr-identity>.icon-button{width:44px;height:44px;min-width:44px;padding:11px}
.cr-description{font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;max-width:65ch;margin:16px 0}
.cr-photo-tools{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}
.cr-photo-tools[hidden],.cr-editor[hidden]{display:none}
.cr-photo-tools button,.cr-photo-upload{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:10px 14px;background:#f4f1f8;border-radius:10px;cursor:pointer;font-size:14px;font-weight:600}
.cr-photo-tools svg{width:18px;height:18px}
.cr-photo-upload:focus-within{box-shadow:inset 0 0 0 2px #625082}
.cr-editor{display:grid;gap:16px;margin:20px 0;padding:20px;background:#f5f2f9;border-radius:12px}
.cr-editor label{margin:0;display:grid;gap:8px;font-size:14px}
.cr-editor input,.cr-editor textarea{width:100%;min-width:0;background:#fff;scroll-margin-block:24px}
.cr-editor textarea{height:88px;min-height:80px;scroll-margin-bottom:76px}
.cr-content:has(>.cr-editor:not([hidden]))>:not(.cr-editor):not(.cr-error){display:none}
.cr-content:has(>.cr-editor:not([hidden]))>.cr-editor{margin:0}
.cr-editor-actions{display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:-1px;padding:8px 0 0;background:#f5f2f9}
.cr-editor-actions button{min-height:44px}
.cr-quick{display:flex;gap:8px;margin:24px 0;flex-wrap:wrap}
.cr-quick button{display:flex;flex:1;min-width:92px;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:68px;padding:10px 8px;border:0;background:#f4f1f8;color:#443852;font-size:12px;border-radius:12px}
.cr-quick button[aria-pressed=true]{background:#e8dff8;color:#3f2d5a}
.cr-quick svg{width:21px;height:21px}
.cr-tabs{display:flex;overflow:auto;gap:4px;padding:4px 0 0;border-bottom:1px solid var(--line);scrollbar-width:none;overscroll-behavior-x:contain}
.cr-tabs button{min-height:46px;white-space:nowrap;flex-shrink:0;background:none;border:0;border-radius:0;padding:10px 12px;color:#62596c;font-size:14px;box-shadow:none}
.cr-tabs button[aria-selected=true]{color:#362746;box-shadow:inset 0 -3px #745791;font-weight:700}
.cr-panel{min-height:120px;outline:none}
.cr-panel-tools{margin:16px 0}
.cr-panel-tools:empty{margin:0}
.cr-search{display:flex;align-items:center;gap:10px;margin:0}
.cr-search>svg{width:19px;height:19px;flex:none;color:#62596c}
.cr-search input{flex:1;min-width:0;min-height:44px;font-size:14px;margin:0}
.cr-add-members{display:inline-flex;align-items:center;gap:8px;min-height:44px;background:#eee7fa;color:#423252}
.cr-add-members svg{width:19px;height:19px}
.cr-member{display:flex;gap:12px;align-items:center;padding:11px 0;border-bottom:1px solid #eeebf2;min-height:68px}
.cr-member .avatar{width:42px;height:42px;min-width:42px;flex:none;border-radius:50%;aspect-ratio:1}
.cr-member-name{display:grid;text-align:left;gap:5px;flex:1;min-width:0;min-height:44px;background:none;border:0;padding:3px 0;font:inherit;box-shadow:none}
.cr-member-name strong{font-size:14px;overflow-wrap:anywhere}
.cr-member-name small{font-size:12px;color:#62596c}
.cr-member>.icon-button{width:44px;height:44px;min-width:44px;padding:10px}
.cr-member-menu{display:grid;gap:4px;max-width:300px}
.cr-member-menu button{display:flex;align-items:center;gap:10px;text-align:left;min-height:44px;white-space:normal}
.cr-member-menu svg{flex:none;width:18px;height:18px}
.cr-list-status{font-size:14px;color:#62596c;line-height:1.6;text-align:center;padding:16px 0;margin:0}
.cr-list-status:empty{display:none}
.cr-more{display:block;min-height:44px;margin:16px auto}
.cr-media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.cr-media-item{min-width:0;border-radius:12px;overflow:hidden;background:#f4f1f8}
.cr-media-item>button{width:100%;aspect-ratio:1;display:grid;place-items:center;position:relative;border:0;padding:0;border-radius:0;background:#eee8f5;overflow:hidden}
.cr-media-item>button>img{width:100%;height:100%;position:absolute;inset:0;object-fit:cover}
.cr-media-item>button>svg{width:35px;height:35px;color:#66527b}
.cr-media-item>button>span{display:grid;place-items:center;position:absolute;inset:auto 10px 10px auto;background:#fff;color:#33253f;width:34px;height:34px;border-radius:50%}
.cr-media-item>button>span svg{width:17px;height:17px}
.cr-media-item>div{display:flex;justify-content:space-between;padding:0 4px;gap:4px}
.cr-media-item .icon-button{width:44px;height:44px;min-width:44px;padding:11px;background:none;border:0;box-shadow:none;color:#493b59}
.cr-file-row{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid #eeebf2;min-width:0}
.cr-file-row>svg{width:22px;height:22px;flex:none;color:#625378}
.cr-file-row>a:not(.icon-button){flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.6;color:#514069}
.cr-file-name{display:grid;flex:1;min-width:0;gap:6px}
.cr-file-name strong{font-size:14px;overflow-wrap:anywhere;font-weight:600}
.cr-file-name small{font-size:12px;color:#62596c}
.cr-file-actions{display:flex;gap:4px;flex:none}
.cr-file-row .icon-button{height:44px;width:44px;min-width:44px;padding:11px;background:none;color:#514069;border:0;box-shadow:none}
.cr-audio-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px}
.cr-audio-row .chat-voice-player{grid-column:1/-1;grid-row:2;min-width:0;width:100%;margin:0}
.cr-audio-row .chat-voice-player button{color:#382647}
.cr-pin-row{display:grid;gap:7px;text-align:left;width:100%;padding:16px 0;border:0;border-bottom:1px solid #eeebf2;border-radius:0;background:none;color:inherit}
.cr-pin-row strong{font-size:14px}.cr-pin-row span{font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.cr-pin-row small{font-size:12px;color:#62596c}
.cr-settings{margin-top:24px;padding-top:16px;border-top:1px solid var(--line)}
.cr-setting{display:flex;align-items:center;gap:12px;min-height:48px;width:100%;text-align:left;padding:12px 4px;background:none;border:0;border-radius:8px;font-size:14px}
.cr-setting svg{width:20px;height:20px;flex:none}
.cr-invite summary{display:flex;align-items:center;gap:12px;min-height:48px;cursor:pointer;font-size:14px;padding:10px 4px}
.cr-invite summary>svg{width:20px;height:20px}
.cr-invite label{font-size:13px;margin:12px 0 0}
.cr-invite input{font-size:13px;width:100%;min-width:0}
.cr-invite-share{display:flex;gap:8px;justify-content:center;margin:12px 0}
.cr-invite-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.cr-invite-actions button{min-height:44px;font-size:13px}
.cr-qr{width:148px;height:148px;display:block;margin:12px auto}
.cr-preview{display:grid;gap:16px;justify-items:center;min-width:0}
.cr-preview>img,.cr-preview video{max-width:100%;max-height:calc(var(--ui-visible-height,100dvh) - 200px);object-fit:contain;border-radius:12px}
.cr-preview>a{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;background:#eee7fa;border-radius:10px;color:#453252;text-decoration:none}
.cr-preview>a svg{width:18px;height:18px}
.cr-message-focus .chat-bubble{animation:cr-highlight 1.6s ease-out}
@keyframes cr-highlight{0%,30%{box-shadow:0 0 0 3px #9c83bc}100%{box-shadow:0 0 0 0 transparent}}
@keyframes cr-enter{from{opacity:.7;transform:translateX(12px)}to{opacity:1;transform:translateX(0)}}
@media(max-width:1000px){.cr-content{padding:22px 18px}.cr-identity{gap:14px}.cr-photo,.cr-photo>.avatar{width:72px;height:72px;min-width:72px}.cr-photo{flex-basis:72px}.cr-name h3{font-size:19px}.cr-quick button{min-width:75px}.cr-media-grid{gap:8px}.cr-header{padding:10px 12px}}
@media(max-width:480px){.cr-content{padding:20px 16px}.cr-quick{gap:6px}.cr-quick button{min-width:0;font-size:11px;padding:10px 4px}.cr-media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cr-editor{padding:14px}.cr-invite-actions button{flex:1}.cr-name h3{font-size:18px}.cr-photo,.cr-photo>.avatar{width:64px;height:64px;min-width:64px}.cr-photo{flex-basis:64px}}
@media(min-width:761px) and (max-width:900px){.messenger-shell:has(.room-info-open){grid-template-columns:minmax(0,1fr)}.messenger-shell:has(.room-info-open) .chat-directory{display:none}}
@container(max-width:360px){.cr-media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container(max-width:240px){.cr-media-grid{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.chat-room-screen,.cr-message-focus .chat-bubble{animation:none}}

#modal:has(.cr-avatar-view){max-width:380px;width:calc(100vw - 32px);border-radius:20px}
#modal:has(.cr-avatar-view)::backdrop{background:rgba(24,18,33,.52);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.cr-avatar-view{display:grid;justify-items:center;gap:20px;padding:12px 4px 8px;min-width:0}
.cr-avatar-large>.avatar{width:min(256px,65vw);height:min(256px,65vw);min-width:0;aspect-ratio:1;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:72px;background:#eee7fa}
.cr-avatar-large .avatar img{width:100%;height:100%;object-fit:cover}.cr-avatar-large .avatar>svg{width:110px;height:110px}
.cr-avatar-view>p{margin:0;text-align:center;max-width:30ch;font-size:13px;line-height:1.6;color:#62596c}
.cr-avatar-view>.inline-error{color:#9e313f}
.cr-avatar-actions{display:flex;align-items:flex-start;justify-content:center;gap:24px}
.cr-avatar-actions button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:88px;min-height:72px;padding:12px;border:0;background:#f1ebf8;border-radius:12px;color:#4b385e;font-size:13px}
.cr-avatar-actions button.danger{color:#9b3041;background:#faedf0}.cr-avatar-actions svg{width:25px;height:25px}
.cr-circle-item{background:transparent;border-radius:0}.cr-circle-item>button{border-radius:50%;overflow:hidden}
.cr-circle-item>button>span{inset:50% auto auto 50%;transform:translate(-50%,-50%)}
.cr-circle-item>div{background:transparent}

/* Reply/file context must never determine the chat's minimum viewport width. */
.messenger-shell,.chat-conversation,.chat-compose,.chat-composer-row,.chat-context{min-width:0;max-width:100%;box-sizing:border-box}
.chat-compose{width:100%}.chat-context>span{flex:1 1 0;min-width:0;max-width:calc(100% - 52px)}
.chat-context>[data-chat-reset]{flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:10px}
.chat-context>[data-remove-file]{display:flex;align-items:center;gap:7px;max-width:100%;min-width:0}
.chat-context>[data-remove-file]>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-context>[data-remove-file]>svg{flex:none}
.chat-composer-row textarea{box-sizing:border-box;max-width:100%;overflow-wrap:anywhere}
.chat-message .chat-message-copy{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;border:0;border-radius:50%;padding:12px;background:transparent;color:#493358}
.chat-message-copy svg{width:19px;height:19px;stroke-width:1.8}.chat-message .chat-message-copy:hover{background:#e8def6}
.chat-message .chat-message-copy:focus-visible{outline:2px solid #70538f;outline-offset:-3px}

.chat-compose .chat-context>button[data-remove-file]{min-height:44px!important}
@media(max-width:760px){.chat-compose .chat-composer-row>.icon-button{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important}}

@media(max-width:760px){.chat-compose .chat-composer-row>#chat-send{width:44px!important;min-width:44px!important}}

@media(max-width:760px){.chat-compose .chat-composer-row{grid-template-columns:44px 44px minmax(0,1fr) 44px 44px}}
