/* Messenger follows UI_UX_GUIDE: shared surfaces/radii, no transition effects. */
.chat-filter-bar{display:flex;align-items:center;gap:6px;padding:0 0 12px;flex-wrap:wrap}
.chat-filter-bar [data-chat-filter]{
 box-sizing:border-box;height:var(--ui-control-height);min-height:var(--ui-control-height);
 padding:0 12px;line-height:20px;border-radius:var(--ui-radius-control)
}
.chat-filter-bar [aria-pressed=true]{background:var(--ui-selected-bg);color:var(--ui-selected-text)}
#chat-notify-permission{margin-left:auto}.chat-filter-bar [hidden]{display:none}
.chat-room-section h3{font-size:12px;font-weight:500;color:var(--muted);padding:16px 14px 6px;margin:0}
.chat-room-section+.chat-room-section{border-top:1px solid var(--line)}
.room-row{position:relative}.room-list .room-row .room-item{padding-right:44px}
.room-list .room-row .room-more{width:34px;min-width:34px;padding:7px;position:absolute;right:4px;top:50%;transform:translateY(-50%)}
.chat-icon-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:34px;min-width:34px;height:34px;min-height:34px;padding:7px;border:0;background:transparent;color:var(--text);border-radius:var(--ui-radius-control)}
.chat-icon-button:hover{background:var(--line)}.chat-icon-button svg,.chat-context-menu svg{width:20px;height:20px;flex-shrink:0;pointer-events:none}
.room-muted{display:flex;flex-shrink:0;color:var(--muted)}.room-muted svg{width:14px;height:14px}
.chat-context-menu{position:fixed;z-index:1100;min-width:185px;max-width:calc(100vw - 16px);padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:var(--ui-radius-surface);box-shadow:0 6px 20px #0002}
.chat-context-menu button{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;text-align:left;padding:9px;font-size:13px;color:var(--text)}
.chat-context-menu button:hover,.chat-context-menu button:focus-visible{background:var(--soft)}
.conversation>header,.conversation .composer{background:var(--soft)}
.conversation .composer textarea{background:var(--panel)}
.messages .message .bubble{background:var(--soft)}.messages .message.mine .bubble{background:transparent}
.conversation>header{grid-template-columns:42px minmax(0,1fr) auto}
.conversation>header>#chat-room-tools{grid-column:3;grid-row:1/3;margin:0;border:0;padding:0}
.conversation>header #chat-room-tools .actions{display:flex;flex-wrap:nowrap;position:static;margin:0;padding:0;gap:2px;background:transparent;border:0;box-shadow:none;min-width:0}
.conversation>header>h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
@media(max-width:1000px){.conversation>header>#chat-room-tools{grid-column:1/-1;grid-row:3;justify-self:end}}
@media(max-width:700px){
 .chat-filter-bar{padding:0 12px 12px;gap:4px}.chat-filter-bar button{min-height:44px}
 .room-list .room-row .room-item{padding-right:48px}.chat-icon-button{min-width:44px;width:44px;height:44px;min-height:44px;padding:12px}
 .mobile-room-open .conversation>header{grid-template-columns:36px 36px minmax(0,1fr);padding-bottom:6px}
 .mobile-room-open .conversation>header>#chat-room-tools{grid-column:1/-1;grid-row:3;justify-self:end;position:static}
 .mobile-room-open .conversation header #chat-room-tools .actions{position:static;display:flex;min-width:0;gap:0}
 .mobile-room-open #chat-room-tools .actions button{width:44px;min-width:44px;height:44px;min-height:44px;padding:12px}
 .mobile-room-open .conversation .composer textarea{background:var(--panel);font-size:14px}
 .chat-context-menu button{min-height:44px}
}


@media(max-width:700px){.room-list .room-row .room-more{width:44px;min-width:44px;padding:12px}}

@media(min-width:1001px){.office-shell .chat-layout{grid-template-columns:300px minmax(0,1fr)}}


.room-preview-row time{font-size:10px;white-space:nowrap;color:var(--muted);font-weight:400;margin-left:4px}

/* Desktop-only shell: native tray/settings, office shortcuts open the browser. */
.desktop-preferences label{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.desktop-preferences select{width:auto;min-width:110px}.desktop-preferences .desktop-toggle{display:flex!important;grid-template-columns:none!important}.desktop-preferences .desktop-toggle input{width:18px;flex:0 0 18px}
.desktop-preferences [data-download-path]{overflow-wrap:anywhere;font-size:12px;flex:1;min-width:120px}
.person-avatar{position:relative}.chat-presence-dot{position:absolute;bottom:-1px;right:-1px;width:10px;height:10px;border:2px solid var(--panel);border-radius:50%;background:#9ca3af;z-index:1;box-sizing:content-box}.chat-presence-dot.online{background:#22a566}.chat-presence-dot.away{background:#f59e0b}

/* Named group avatars and member actions, shared by the web and desktop app. */
.room-title-avatar{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;border-radius:50%;background:#2864ce;color:#fff;font-size:13px;font-weight:600;line-height:1;overflow:hidden}
#chat-header-profile .room-title-avatar,#chat-header-profile .room-avatar-stack{width:36px;height:36px;flex-basis:36px}
.chat-participant-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;border-bottom:1px solid var(--line)}
.chat-participant-row .participant-profile{display:flex;align-items:center;gap:8px;min-width:0;flex:1;text-align:left}.chat-participant-row .participant-profile>span:last-child{min-width:0;overflow-wrap:anywhere}
.chat-participants>.actions{justify-content:space-between}.chat-participant-list{max-height:55vh;overflow:auto}.chat-participant-row .person-avatar{flex-shrink:0}
@media(max-width:700px){.chat-participant-row .chat-icon-button{min-width:44px;min-height:44px}}
/* Desktop messenger keeps work modules in the default browser. */
.desktop-web-shortcuts{display:flex;align-items:center;gap:4px;min-width:0}
.desktop-web-shortcuts button{width:32px;height:32px;min-height:32px;padding:6px;display:inline-flex;align-items:center;justify-content:center}
.desktop-web-shortcuts svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){.desktop-web-shortcuts{gap:2px}.desktop-web-shortcuts button{width:28px;height:28px;min-height:28px;padding:5px}}

/* Compact room metadata: unread above time, independent of the avatar colour. */
.room-list .room-row .room-item{padding-right:42px;gap:10px}
.room-copy{min-width:0;flex:1}.room-meta{display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:7px;flex:none;max-width:100px;font-size:11px;color:var(--muted)}
.room-meta time{white-space:nowrap}.room-unread-slot{height:20px;display:flex;align-items:center}
.room-item .room-meta .room-unread{background:#dc2626;color:#fff;min-width:20px;height:20px;padding:1px 6px;border-radius:999px;line-height:18px;text-align:center}
.room-list .room-row .room-more{top:50%;bottom:auto;transform:translateY(-50%);height:28px;min-height:28px;margin:0;padding:5px}
.chat-splitter{display:none}
/* Chat needs less width than office document tables. Keep those tables unchanged. */
/* 2026-11-13: PC 최소 폭(900px) 제거. 화면 폭에 맞춰 줄고 700px 이하는 모바일 화면 */
@media(min-width:701px){.office-shell .chat-layout{grid-template-columns:min(var(--chat-list-width,300px),42%) 8px minmax(0,1fr);gap:6px}.chat-splitter{display:block;cursor:col-resize;touch-action:none;border-radius:4px;background:transparent;position:relative}.chat-splitter:after{content:'';position:absolute;top:40%;bottom:40%;left:3px;width:2px;background:var(--line)}.chat-splitter:hover,.chat-splitter:focus-visible{background:var(--soft);outline:1px solid var(--line)}}
.chat-photo-preview{display:block;max-width:320px;border-radius:var(--ui-radius-control);overflow:hidden;border:1px solid var(--line);background:var(--soft)}
.chat-photo-preview img{display:block;width:100%;max-height:300px;object-fit:contain;min-height:50px}
.chat-link-preview{display:grid;grid-template-columns:36px minmax(0,1fr);gap:4px 10px;max-width:320px;min-width:180px;padding:12px;margin:6px 0;border:1px solid var(--line);border-radius:var(--ui-radius-control);background:var(--panel);color:var(--text);text-decoration:none}
.chat-link-preview>span{grid-row:1/3;align-self:center}.chat-link-preview svg{width:26px;height:26px}.chat-link-preview strong,.chat-link-preview small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.message .bubble.recalled{color:var(--muted);font-size:12px}.message-target .bubble{outline:2px solid var(--work-point,#2563eb)}
.chat-reply-quote{display:flex;flex-direction:column;gap:5px;text-align:left;max-width:320px;width:100%;padding:8px 12px;border:0;border-left:3px solid var(--work-point,#2563eb);border-radius:var(--ui-radius-control);background:var(--soft);box-shadow:none;font-size:12px}
.chat-reply-quote span{font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
#chat-reply-draft{grid-column:1/-1;grid-row:1;display:flex;gap:10px;align-items:center;justify-content:space-between;font-size:12px;padding:8px;border-left:3px solid var(--work-point,#2563eb);background:var(--panel);min-width:0}
#chat-reply-draft>span{min-width:0}#chat-reply-draft small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#chat-reply-draft button{min-width:28px;padding:4px;min-height:28px}
#chat-notice{display:flex;gap:8px;align-items:center;padding:8px 14px;background:var(--soft);border-bottom:1px solid var(--line);flex-shrink:0}
#chat-notice button{background:transparent;border:0;box-shadow:none;padding:4px 6px}.chat-notice-text{display:flex;flex-direction:column;min-width:0;flex:1;text-align:left;font-size:12px}.chat-notice-text span{display:block;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400}.chat-notice-clear{flex:none}
#chat-notice[hidden],#chat-reply-draft[hidden]{display:none}
.home-gadget .gadget-counter{display:flex;flex:1;flex-direction:column;align-items:center;gap:8px;border:0;box-shadow:none;background:transparent;padding:12px;border-radius:var(--ui-radius-control)}
.home-gadget .gadget-counter:hover{background:var(--panel)}.home-gadget .gadget-counter strong{font-size:28px}.home-gadget [data-home-leave]{margin-top:12px}
@media(max-width:700px){.room-meta{max-width:85px;font-size:10px}.chat-photo-preview,.chat-link-preview,.chat-reply-quote{max-width:min(300px,65vw)}.message-actions button{min-height:32px}.room-list .room-row .room-more{bottom:5px;height:44px;min-height:44px;padding:12px}}
.chat-popout,.chat-popout body{min-width:0!important;width:100%;height:100%;overflow:hidden}
.chat-popout .office-shell{display:block!important;min-width:0!important;min-height:0!important;height:100dvh;padding:0!important}
.chat-popout .office-shell>.topbar,.chat-popout .app-rail,.chat-popout .module-side,.chat-popout .mobile-tabs,.chat-popout .chat-filter-bar,.chat-popout .room-list,.chat-popout .chat-splitter{display:none!important}
.chat-popout .office-shell .main,.chat-popout .office-shell .content{width:100%;min-width:0;max-width:none;height:100%;margin:0;padding:0!important}
.chat-popout .office-shell .chat-layout{display:block!important;width:100%;height:100dvh;min-height:0;margin:0;padding:0}
.chat-popout .chat-layout .conversation{display:flex!important;width:100%;height:100%;min-height:0;border:0;border-radius:0}
.chat-popout .conversation>header{display:grid;grid-template-columns:42px minmax(0,1fr) auto auto;min-width:0;padding:12px;gap:2px 8px;flex:none}
.chat-popout .conversation #mobile-chat-back{display:inline-flex;grid-column:3;grid-row:1/3;align-items:center;justify-content:center;width:auto;min-width:40px;height:32px;min-height:32px;margin:0;font-size:12px}
.chat-popout #mobile-chat-back:before{content:none}
.chat-popout .conversation #chat-header-profile{grid-column:1;grid-row:1/3}
.chat-popout .conversation>header h2{grid-column:2;grid-row:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-popout .conversation>header #chat-status{grid-column:2;grid-row:2}
.chat-popout .conversation>header #chat-room-tools{grid-column:4;grid-row:1/3;justify-self:end}
@media(max-width:480px){.chat-popout .conversation>header{grid-template-columns:42px minmax(0,1fr) auto}.chat-popout .conversation>header #chat-room-tools{grid-column:1/-1;grid-row:3}}
.chat-popout .conversation .messages{min-height:0;flex:1;overflow:auto}

/* Compact message surfaces; effects only run when explicitly jumping to a message. */
.room-list .room-row .room-more{top:50%;bottom:auto;transform:translateY(-50%)}
.chat-photo{position:relative;max-width:310px;min-width:0}
.chat-photo-download{position:absolute;right:8px;top:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:1px solid var(--line);border-radius:var(--ui-radius-control);background:var(--panel);color:var(--text);box-shadow:var(--ui-surface-shadow);opacity:0;text-decoration:none;font-size:20px}
.chat-photo:hover .chat-photo-download,.chat-photo:focus-within .chat-photo-download{opacity:1}
@media(hover:none){.chat-photo-download{opacity:1;width:40px;height:40px}}
/* One anchor per bubble, with a pointer bridge across the 6px visual gap. */
.messages .message{width:fit-content;max-width:calc(100% - 114px)}
.messages .message.mine{max-width:calc(100% - 148px)}
.message .message-content{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:7px;min-width:0}
.message .message-content>*{grid-column:1;min-width:0}
.message .message-author{grid-row:1}
.message .message-main{grid-row:2;position:relative;min-width:0;outline:none}
.message-main:focus-visible{outline:2px solid var(--work-point,#2563eb);outline-offset:3px;border-radius:var(--ui-radius-control)}
.message.mine .message-content{grid-template-columns:auto minmax(0,1fr)}
.message.mine .message-content>*{grid-column:2}
.message .message-content>.message-meta{grid-column:2;grid-row:2;align-self:end;display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 0 2px;white-space:nowrap;line-height:1.3}
.message.mine .message-content>.message-meta{grid-column:1;align-items:flex-end}
.message-actions{position:absolute;left:100%;bottom:0;padding-left:6px;z-index:5;opacity:0;visibility:hidden;pointer-events:none;white-space:nowrap}
.message.mine .message-actions{left:auto;right:100%;padding-left:0;padding-right:6px}
.message-action-buttons{display:flex;gap:0;padding:3px;border:1px solid var(--line);border-radius:var(--ui-radius-control);background:var(--panel);box-shadow:var(--ui-surface-shadow)}
.message-action-buttons:empty{display:none}
.message-actions button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;min-width:32px;height:32px;min-height:32px;margin:0;padding:6px;border:0;box-shadow:none;background:transparent;color:var(--muted);border-radius:6px}
.message-actions svg{width:20px;height:20px;display:block;pointer-events:none}
.message-actions button:hover,.message-actions button:focus-visible{background:var(--soft);color:var(--text)}
.message-actions button[data-chat-recall]:hover{color:#d92d20}
.message:hover .message-actions,.message:focus-within .message-actions{opacity:1;visibility:visible;pointer-events:auto}
.message .message-content>.message-reactions{grid-row:3;display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.message.mine .message-reactions{justify-content:flex-end}
.message .message-content>.message-reactions:empty{display:none}
.message-reactions .chat-reaction-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:2px 7px;min-width:0;min-height:24px;font-size:12px;line-height:18px;box-shadow:none;color:var(--text)}
.message-reactions .chat-reaction-chip[aria-pressed=true]{border-color:var(--work-point,#2563eb);color:var(--work-point,#2563eb)}
.chat-reaction-picker{position:fixed;z-index:1200;display:flex;gap:2px;padding:6px;background:var(--panel);border:1px solid var(--line);border-radius:var(--ui-radius-overlay);box-shadow:var(--ui-surface-shadow)}
.chat-reaction-picker button{display:flex;align-items:center;justify-content:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:4px;border:0;background:transparent;box-shadow:none;font-size:22px;border-radius:6px}
.chat-reaction-picker button:hover,.chat-reaction-picker button:focus-visible,.chat-reaction-picker button[aria-pressed=true]{background:var(--soft);outline:1px solid var(--work-point,#2563eb)}
@media(hover:none){
 .messages .message,.messages .message.mine{max-width:100%}
 .message .message-actions{left:0;right:auto;bottom:100%;padding:0 0 4px;opacity:0;visibility:hidden;pointer-events:none}
 .message.mine .message-actions{left:auto;right:0}
 .message-mobile-actions .message-actions,.message:focus-within .message-actions{opacity:1;visibility:visible;pointer-events:auto}
 .message-actions button{width:36px;min-width:36px;height:36px;min-height:36px}
}
.message-unread{color:var(--work-point,#2563eb)}
.bubble ul,.bubble ol{white-space:normal;margin:0;padding-left:22px}.bubble li{white-space:pre-wrap}.bubble>div{min-height:1em}
.message-target :is(.bubble,.chat-photo-preview,.chat-file-card){animation:chat-message-jump .45s ease-out;outline:2px solid var(--work-point,#2563eb);outline-offset:2px}
@keyframes chat-message-jump{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}60%{transform:translateX(4px)}}
@media(prefers-reduced-motion:reduce){.message-target :is(.bubble,.chat-photo-preview,.chat-file-card){animation:none}}
.chat-search-result{display:block;width:100%;text-align:left;border:0;background:transparent;box-shadow:none;padding:10px}.chat-search-result small,.chat-search-result span{display:block}.chat-search-result:hover{background:var(--soft)}
.conversation .composer .chat-compose-tools{display:flex;align-items:center;gap:2px;grid-column:1/3;grid-row:4;min-width:0;position:relative;flex-wrap:nowrap}
.chat-compose-tools button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;min-width:36px;height:36px;min-height:36px;padding:5px;border:0;box-shadow:none;background:transparent;color:var(--text);font-size:18px;line-height:1}
.conversation .composer .chat-compose-tools #chat-attach{width:36px;min-width:36px;height:36px;min-height:36px;padding:5px;color:var(--text)}
.chat-compose-tools button svg,.conversation .composer .chat-compose-tools #chat-attach svg{display:block;width:var(--ui-icon-size);height:var(--ui-icon-size);flex:none}
.conversation .composer>.actions{grid-column:3;grid-row:4;justify-content:flex-end}
.chat-compose-tools .chat-file-control{flex:0 0 auto}
.chat-compose-tools button:hover,.chat-compose-tools button[aria-expanded=true],.chat-compose-tools button[aria-pressed=true]{background:var(--soft)}
.chat-compose-tools button[aria-pressed=true]{box-shadow:inset 0 0 0 1px var(--line)}
.chat-compose-tools button[data-number-toggle]{width:var(--ui-control-height);min-width:var(--ui-control-height);height:var(--ui-control-height);min-height:var(--ui-control-height);border-radius:var(--ui-radius-control)}
.chat-list-line{padding-left:2em;text-indent:-2em;white-space:pre-wrap}
.chat-format-options{display:flex;gap:2px;border-left:1px solid var(--line);padding-left:4px;min-width:0;overflow-x:auto;scrollbar-width:thin;margin-left:auto}
.chat-compose-tools [data-format-toggle]{margin-left:auto}
.chat-format-options:not([hidden])+[data-format-toggle]{margin-left:0}
.chat-emoji-options{position:absolute;bottom:100%;left:0;display:grid;grid-template-columns:repeat(6,36px);padding:8px;border:1px solid var(--line);border-radius:var(--ui-radius-overlay);background:var(--panel);box-shadow:var(--ui-surface-shadow);z-index:4}
.chat-emoji-options button{font-size:22px}.chat-compose-tools [hidden]{display:none}
@media(max-width:700px){.chat-compose-tools button{min-height:36px;min-width:36px}.message .message-content>.message-meta{font-size:9px;column-gap:4px}}
@media(max-width:700px){
 .mobile-room-open .conversation .composer .chat-text-editor{grid-column:1/-1;grid-row:3}
 .mobile-room-open .conversation .composer textarea{grid-column:1/-1;min-height:66px}
 .mobile-room-open .conversation .composer .chat-compose-tools{grid-column:1/3;grid-row:4}
 .mobile-room-open .conversation .composer>.actions{grid-column:3;grid-row:4}
}

#conversation{position:relative}
#chat-notice .chat-notice-options{display:flex;align-items:center;gap:2px;flex:none}
#chat-notice .chat-notice-options button{white-space:nowrap;font-size:11px;min-height:30px}
#chat-notice.is-folded{position:absolute;right:12px;top:72px;z-index:5;padding:0;border:0;background:transparent}
#chat-notice .chat-notice-restore{display:grid;place-items:center;width:36px;height:36px;padding:8px;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--text);box-shadow:0 3px 10px #0002}
#chat-notice .chat-notice-restore svg{display:block;width:20px;height:20px}
@media(max-width:700px){#chat-notice.is-folded{top:56px;right:10px}#chat-notice{padding:6px 10px;gap:4px}#chat-notice .chat-notice-options{flex-direction:column;gap:0}#chat-notice .chat-notice-options button{min-height:24px;padding:2px 4px}}
.chat-read-divider{display:flex;align-items:center;gap:12px;margin:18px 0;color:var(--muted);font-size:12px;clear:both}
.chat-read-divider::before,.chat-read-divider::after{content:"";height:1px;flex:1;background:var(--line)}
.chat-read-divider span{white-space:nowrap}
.room-list .room-row{display:grid;grid-template-columns:minmax(0,1fr) 36px;align-items:center}
.room-list .room-row .room-item{min-width:0;padding-right:8px!important}
.room-list .room-row .room-more{position:static;transform:none;align-self:center;width:34px;min-width:0;padding:6px}

/* Windows messenger: one compact toolbar, responsive room panels. */
html.messenger-desktop body .office-shell{display:block!important;padding:0!important;min-width:0;max-width:100%;min-height:100dvh;overflow-x:clip}
html.messenger-desktop body .office-shell>.topbar,html.messenger-desktop .app-rail,html.messenger-desktop #subnav,html.messenger-desktop .mobile-tabs,html.messenger-desktop .mobile-bottom-nav,html.messenger-desktop .mobile-topbar{display:none!important}
html.messenger-desktop body .office-shell .main{margin:0!important;padding:56px 0 0!important;width:100%!important;min-width:0;max-width:none;grid-column:1/-1}
html.messenger-desktop .office-shell .content{padding:12px;min-width:0;max-width:none}
html.messenger-desktop .desktop-web-shortcuts{position:fixed;inset:0 0 auto;height:56px;display:flex;flex-direction:row;align-items:center;gap:4px;padding:6px 12px;background:var(--panel);border-bottom:1px solid var(--line);z-index:30;box-sizing:border-box}
html.messenger-desktop .desktop-web-shortcuts button{position:relative;flex:none;width:38px;height:38px;min-height:38px;padding:8px;border:0;box-shadow:none;background:transparent;color:var(--text);display:inline-flex;align-items:center;justify-content:center}
html.messenger-desktop .desktop-web-shortcuts button:hover,html.messenger-desktop .desktop-web-shortcuts button.is-current{background:var(--soft)}
html.messenger-desktop .desktop-web-shortcuts svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7}
html.messenger-desktop .desktop-rail-bottom{margin-left:auto;display:flex;align-items:center;gap:4px}
html.messenger-desktop .desktop-rail-bottom #logout{font-size:10px;width:auto}
html.messenger-desktop .desktop-rail-bottom .identity{padding:0;border-radius:50%}
html.messenger-desktop .desktop-rail-bottom .person-avatar{width:30px;height:30px;font-size:12px}
html.messenger-desktop [data-page=chat] #content{height:calc(100dvh - 56px);padding:10px 12px;display:flex;flex-direction:column;min-height:0;box-sizing:border-box;overflow:hidden}
html.messenger-desktop .chat-filter-bar{flex:0 0 42px;align-items:flex-start;padding:0;gap:6px}
html.messenger-desktop #chat-notify-permission{display:none!important}
html.messenger-desktop .office-shell .chat-layout{position:relative!important;inset:auto!important;display:grid!important;grid-template-columns:var(--chat-list-width,300px) 8px minmax(0,1fr)!important;gap:6px;width:100%;flex:1;min-height:0;height:auto!important;z-index:auto;overflow:hidden}
html.messenger-desktop .chat-layout .room-list{display:block!important;grid-column:1;grid-row:1;height:100%;max-height:none;min-width:0;overflow-y:auto;overflow-x:hidden;padding:0 0 70px;box-sizing:border-box}
html.messenger-desktop .chat-layout .chat-splitter{display:block;grid-column:2;grid-row:1}
html.messenger-desktop .chat-layout .conversation{display:flex!important;grid-column:3;grid-row:1;min-width:0;min-height:0;height:100%;max-height:none;border:1px solid var(--line);border-radius:var(--ui-radius-surface);overflow:hidden}
html.messenger-desktop .room-list .room-row{display:block!important;border:0;border-radius:12px;margin:2px 0}
html.messenger-desktop .room-list .room-row:hover{background:var(--soft)}
html.messenger-desktop .room-list .room-row .room-item{width:100%;min-width:0;max-width:100%;padding:12px 40px 12px 10px!important;border:0;border-radius:12px;box-sizing:border-box;overflow:hidden}
html.messenger-desktop .room-list .room-row .room-more{position:absolute!important;right:4px;top:50%;transform:translateY(-50%);width:30px;height:30px;min-height:30px;min-width:0;padding:6px;opacity:0;display:inline-flex!important}
html.messenger-desktop .room-row:hover .room-more,html.messenger-desktop .room-row:focus-within .room-more{opacity:1}
html.messenger-desktop .room-item .room-main,html.messenger-desktop .room-item .room-preview-row,html.messenger-desktop .room-item .room-title-row{min-width:0;max-width:100%}
html.messenger-desktop #content #new-room.desktop-new-room{display:grid!important;place-items:center;position:absolute;bottom:16px;left:calc(var(--chat-list-width,300px) - 64px);z-index:8;width:48px;height:48px;min-height:48px;margin:0;padding:0;border-radius:50%;font-size:30px;line-height:1;box-shadow:0 4px 14px #0003}
html.messenger-desktop #new-room span{display:block;line-height:1;transform:translateY(-1px)}
html.messenger-desktop #mobile-chat-back{display:none!important}
html.messenger-desktop .conversation>header{grid-template-columns:42px minmax(0,1fr) auto}
html.messenger-desktop .conversation>header>#chat-room-tools{grid-column:3;grid-row:1/3}
html.messenger-desktop .conversation .composer{padding:10px}
html.messenger-desktop .desktop-preferences{display:flex;flex-direction:column;gap:10px;max-width:520px;margin:auto}
html.messenger-desktop .desktop-preferences .desktop-toggle{padding:0!important;min-height:28px!important;margin:0!important}
.desktop-menu-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.desktop-menu-grid button{display:flex;align-items:center;gap:10px}.desktop-menu-grid svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7}
@media(width < 600px){
 html.messenger-desktop .office-shell .chat-layout{grid-template-columns:minmax(0,1fr)!important}
 html.messenger-desktop .chat-layout .chat-splitter,html.messenger-desktop .chat-layout .conversation{display:none!important}
 html.messenger-desktop .chat-layout.mobile-room-open .room-list,html.messenger-desktop #content .chat-layout.mobile-room-open #new-room.desktop-new-room{display:none!important}
 html.messenger-desktop .chat-layout.mobile-room-open .conversation{display:flex!important;grid-column:1}
 html.messenger-desktop #content:has(.mobile-room-open) .chat-filter-bar{display:none}
 html.messenger-desktop #mobile-chat-back{display:inline-flex!important}
 html.messenger-desktop .conversation>header{grid-template-columns:34px 38px minmax(0,1fr) auto}
 html.messenger-desktop .conversation>header>#chat-room-tools{grid-column:4;grid-row:1/3}
 html.messenger-desktop #content #new-room.desktop-new-room{left:auto;right:16px}
}
@media(max-width:760px){html.messenger-desktop [data-desktop-nav=mail],html.messenger-desktop [data-desktop-nav=calendar],html.messenger-desktop [data-desktop-nav=approvals],html.messenger-desktop [data-desktop-nav=collaboration]{display:none!important}}
html.messenger-desktop.chat-popout .desktop-web-shortcuts{display:none!important}
html.messenger-desktop.chat-popout body .office-shell .main{padding:0!important}
html.messenger-desktop.chat-popout [data-page=chat] #content{height:100dvh!important;padding:0!important}
html.messenger-desktop.chat-popout .chat-filter-bar,html.messenger-desktop.chat-popout .chat-layout .room-list,html.messenger-desktop.chat-popout .chat-splitter,html.messenger-desktop.chat-popout #content #new-room.desktop-new-room{display:none!important}
html.messenger-desktop.chat-popout .office-shell .chat-layout{grid-template-columns:minmax(0,1fr)!important}
html.messenger-desktop.chat-popout .chat-layout .conversation{display:flex!important;grid-column:1;border-radius:0}
html.messenger-desktop.chat-popout #mobile-chat-back{display:inline-flex!important}
.notification-item .notification-copy{display:flex;flex-direction:column;min-width:0;gap:4px;text-align:left}.notification-item:has(.person-avatar){display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;align-items:start}.notification-item .person-avatar{width:36px;height:36px}.notification-item .chat-presence-dot{display:none}
html.messenger-desktop body:has(.office-shell),html.messenger-desktop #app{min-width:0!important;width:100%;max-width:100%;overflow-x:clip}

/* Keep the close control in its header, away from the shortcut grid. */
dialog:has(.desktop-menu-grid)>header{position:relative;display:flex;align-items:center;justify-content:space-between;min-height:40px;gap:16px;margin-bottom:20px;padding-right:0}
dialog:has(.desktop-menu-grid)>header #close-dialog{position:static;flex:0 0 36px;width:36px;height:36px;min-height:36px;margin:0;padding:0;display:grid;place-items:center}
.desktop-menu-grid button{min-width:0;padding:12px;text-align:left}.desktop-menu-grid button span{overflow-wrap:anywhere}
html.messenger-desktop #content #new-room.desktop-new-room{width:48px;height:48px;border:0;background:var(--text);color:var(--panel);box-shadow:0 4px 12px #0002;transition:box-shadow .15s,transform .15s}
html.messenger-desktop #new-room.desktop-new-room:hover{transform:translateY(-2px);box-shadow:0 6px 16px #0003}
html.messenger-desktop #new-room.desktop-new-room span{font-size:28px;font-weight:400;transform:none}
@media(prefers-reduced-motion:reduce){html.messenger-desktop #new-room.desktop-new-room{transition:none}}

/* Native messenger stays split on compact desktop windows; mobile web keeps its own layout. */
html.messenger-desktop .room-list{container-type:inline-size;container-name:chat-list}
html.messenger-desktop .conversation{container-type:inline-size;container-name:chat-conversation}
html.messenger-desktop .chat-splitter{cursor:col-resize;touch-action:none;position:relative}
html.messenger-desktop .chat-splitter:after{content:'';position:absolute;top:35%;bottom:35%;left:3px;width:2px;background:var(--line)}
@container chat-list (max-width:260px){
 html.messenger-desktop .room-list .room-row .room-item{display:grid;grid-template-columns:36px minmax(0,1fr);padding:10px 26px 10px 6px!important;gap:2px 8px}
 html.messenger-desktop .room-item>.room-avatar-stack,html.messenger-desktop .room-item>.room-title-avatar{width:36px;height:36px;grid-row:1/3;align-self:start;flex-basis:36px;font-size:12px}
 html.messenger-desktop .room-item .room-avatar-stack:not(.room-group-avatar) .person-avatar{width:36px;height:36px}
 html.messenger-desktop .room-item .room-copy{grid-column:2}
 html.messenger-desktop .room-item .room-meta{grid-column:2;flex-direction:row;align-items:center;gap:4px;max-width:none;font-size:10px}
 html.messenger-desktop .room-item .room-meta time{overflow:hidden;text-overflow:ellipsis}
 html.messenger-desktop .room-item .room-unread-slot:empty{display:none}
 html.messenger-desktop .room-preview{min-width:0;max-width:100%}
}
@media(width > 700px){
@container chat-conversation (max-width:380px){
 html.messenger-desktop .office-shell .chat-layout .conversation>header{grid-template-columns:36px minmax(0,1fr)!important;gap:2px 8px;padding:8px!important}
 html.messenger-desktop .office-shell .chat-layout .conversation>header>#chat-room-tools{grid-column:1/-1!important;grid-row:3!important;justify-self:end}
 html.messenger-desktop .office-shell .chat-layout .conversation>header>#chat-room-tools>summary{display:none!important}
 html.messenger-desktop .office-shell .chat-layout .conversation>header>#chat-room-tools>.actions{display:flex!important;position:static!important;flex-wrap:wrap;width:auto!important;padding:0!important;border:0!important;box-shadow:none!important}
 html.messenger-desktop .office-shell .chat-layout #chat-room-tools .actions button{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;padding:6px!important}
 html.messenger-desktop .office-shell .chat-layout #chat-room-tools .actions button::after{content:none}
 html.messenger-desktop .office-shell .chat-layout .composer .chat-compose-tools{flex-wrap:wrap;grid-column:1/-1!important}
 html.messenger-desktop .office-shell .chat-layout .composer>.actions{grid-column:1/-1!important;grid-row:5!important;justify-content:flex-end}
}
}
@media(min-width:600px) and (max-width:700px){
 html.messenger-desktop .office-shell[data-page=chat] #content{padding:10px 12px!important}
 html.messenger-desktop .office-shell .chat-layout.mobile-room-open{height:auto!important}
 html.messenger-desktop .office-shell .chat-layout .conversation>header>h2,html.messenger-desktop .office-shell .chat-layout .conversation>header>#chat-status{grid-column:2!important}
 html.messenger-desktop .office-shell .chat-layout #chat-header-profile{display:block}
 html.messenger-desktop .office-shell .chat-layout .conversation>header{grid-template-columns:36px minmax(0,1fr) 40px!important;padding:8px!important;gap:2px 8px}
 html.messenger-desktop .office-shell .chat-layout .conversation>header>#chat-room-tools{grid-column:3!important;grid-row:1/3!important}
 html.messenger-desktop .office-shell .chat-layout .composer .chat-compose-tools{grid-column:1/-1!important;flex-wrap:wrap}
 html.messenger-desktop .office-shell .chat-layout .composer>.actions{grid-column:1/-1!important;grid-row:5!important;justify-content:flex-end}
}

/* Overlay only the jump button; the message viewport keeps all available height. */
.conversation .chat-message-stage{position:relative;display:flex;flex:1 1 0;min-height:0;min-width:0;overflow:hidden}
.conversation .chat-message-stage>.messages{min-height:0;min-width:0;width:100%;box-sizing:border-box}
.conversation .chat-message-stage>#chat-latest{position:absolute;right:24px;bottom:12px;z-index:5;display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;padding:8px;margin:0;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--text);box-shadow:0 2px 8px #0003}
.conversation .chat-message-stage>#chat-latest[hidden]{display:none}
.conversation .chat-message-stage>#chat-latest svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
@media(pointer:coarse){.conversation .chat-message-stage>#chat-latest{width:44px;height:44px;min-width:44px;min-height:44px}}
@container chat-conversation (max-width:380px){
 html.messenger-desktop .messages .message,html.messenger-desktop .messages .message.mine{max-width:100%}
 html.messenger-desktop .message .message-actions{left:auto;right:0;bottom:100%;padding:0 0 4px}
}

/* Vector plus has a geometric centre; folded notices own a header row. */
html.messenger-desktop #content #new-room.desktop-new-room{padding:0;line-height:0;transition:none}
html.messenger-desktop #new-room.desktop-new-room:hover{transform:none}
html.messenger-desktop #new-room.desktop-new-room>svg{display:block;width:24px;height:24px;margin:0;pointer-events:none}
.conversation>header>#chat-notice.is-folded{position:static;grid-column:1/-1;grid-row:4;justify-self:end;align-self:center;padding:0;margin:4px 0 0;border:0;background:transparent;z-index:auto}
.conversation>header>#chat-notice .chat-notice-restore{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;height:30px;min-height:30px;padding:4px 10px;border-radius:var(--ui-radius-control);font-size:12px;line-height:20px;box-shadow:none}
.conversation>header>#chat-notice .chat-notice-restore svg{width:18px;height:18px;flex:none}
.composer .chat-lock-hint{grid-column:1/-1;grid-row:6;margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.composer .chat-lock-hint[hidden]{display:none}
.composer[data-input-locked="true"] textarea:disabled{cursor:not-allowed;opacity:.7}
.composer[data-input-locked="true"] :is(#mention-picker,.chat-emoji-options,.chat-format-options){display:none}
#room-input-lock[aria-pressed="true"]{color:var(--accent);background:var(--panel)}

/* Room collections use bounded queries without changing message read positions. */
#conversation{position:relative}
.chat-collection{position:absolute;inset:0 0 0 auto;z-index:12;width:min(350px,100%);display:flex;flex-direction:column;gap:12px;padding:14px;background:var(--panel);color:var(--text);border-left:1px solid var(--line);box-shadow:-8px 0 20px #0002;min-height:0;text-align:left;box-sizing:border-box}
.chat-collection[hidden]{display:none!important}
.collection-header{display:flex;align-items:center;gap:8px;flex:none}
.collection-header strong{flex:1;min-width:0;font-size:15px}
.collection-header .chat-icon-button{flex:none}
.collection-room-name{margin:0;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.collection-categories{display:grid;gap:8px}
.collection-categories>button{display:flex;align-items:center;gap:10px;text-align:left;min-height:44px;padding:8px 12px}
.collection-categories>button>span:first-of-type{flex:1}
.collection-categories svg{width:20px;height:20px;flex:none}
.collection-search{display:flex;gap:5px;flex:none;min-width:0;margin:0}
.collection-search input{min-width:0;flex:1;width:0}
.collection-search button{flex:none}
.collection-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;padding:1px 2px 8px}
.collection-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.collection-grid.collection-files{grid-template-columns:minmax(0,1fr)}
.collection-card{min-width:0;padding:8px;border:1px solid var(--line);border-radius:var(--ui-radius-control);background:var(--panel)}
.collection-meta{display:block;margin:7px 0;color:var(--muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.collection-card>button{font-size:12px;width:100%;padding-inline:4px}
.collection-card .chat-file-cards{display:block;margin:0;max-width:100%}
.collection-card .chat-photo{width:100%;max-width:100%;margin:0}
.collection-card .chat-photo-preview{display:block;width:100%}
.collection-card .chat-photo-preview img{display:block;width:100%;height:110px;max-width:100%;object-fit:cover}
.collection-card .chat-file-card{width:100%;max-width:100%;min-width:0;padding:6px;box-sizing:border-box}
.collection-card .chat-file-card>span{min-width:0}
.collection-card .chat-file-card strong{white-space:normal;overflow-wrap:anywhere}
.collection-link{display:flex;flex-direction:column;gap:6px;color:var(--text);text-decoration:none;min-width:0}
.collection-link-icon{display:grid;place-items:center;height:90px;background:var(--soft);border-radius:var(--ui-radius-control)}
.collection-link-icon svg{width:34px;height:34px;color:var(--muted)}
.collection-link strong,.collection-link>span:last-child{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px}
.collection-link>span:last-child{color:var(--muted)}
.collection-link::after{content:none!important}
.collection-status{font-size:12px;line-height:1.6;color:var(--muted);margin:12px 0}
#collection-more{width:100%}
.collection-original-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:14px;margin:12px 0}
.collection-original-body a{overflow-wrap:anywhere}
@media(min-width:1200px){#conversation.has-collection{padding-right:350px}}
@media(max-width:700px){.chat-collection{width:100%;padding:12px;border-left:0}.collection-header .chat-icon-button{min-width:36px;min-height:36px}}

.chat-schedule-preview{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;margin:12px 0}
.chat-schedule-item{border-bottom:1px solid var(--border);padding:12px 0}
.chat-schedule-item .ui-meta-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chat-schedule-button{flex:none}
#chat-schedule-form input[type=datetime-local]{min-width:0;max-width:100%}

/* Settings panels keep the save action visible and preserve unsaved values. */
.desktop-settings-tabs{display:flex;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.desktop-settings-tabs [aria-selected=true]{background:var(--ui-selected-bg);color:var(--ui-selected-text)}
.desktop-preferences [role=tabpanel]{display:flex;flex-direction:column;gap:12px;max-height:55dvh;overflow:auto;padding:8px 2px}
.desktop-preferences [role=tabpanel][hidden]{display:none!important}
.desktop-preferences>.actions{position:sticky;bottom:0;background:var(--panel);padding:12px 0 0;border-top:1px solid var(--line);flex-shrink:0}
.room-list>.chat-filter-bar{position:sticky;top:0;z-index:3;background:var(--panel);padding:4px 0 12px;flex-wrap:wrap}
html.messenger-desktop .room-list>.chat-filter-bar{padding:0 0 12px;min-height:42px;box-sizing:border-box}

.room-list>.chat-filter-bar [data-chat-filter]{width:auto!important;flex:1 1 0;min-width:0;display:inline-flex;align-items:center;justify-content:center;margin:0;padding-inline:4px;white-space:nowrap;text-align:center;font-size:12px}

/* A compact footer at every window width; formatting never consumes row space. */
html .conversation #message-form.composer{grid-template-columns:minmax(0,1fr) auto!important}
html .conversation #message-form.composer .chat-compose-tools{grid-column:1!important;grid-row:4!important;flex-wrap:nowrap!important;gap:2px}
html .conversation #message-form.composer>.actions{grid-column:2!important;grid-row:4!important;display:flex;flex-wrap:nowrap;gap:4px;align-items:center;margin:0}
html .conversation #message-form.composer .chat-compose-tools [data-format-toggle]{margin-left:0}
html .conversation #message-form.composer .chat-format-options{position:absolute;bottom:calc(100% + 8px);left:0;right:auto;width:max-content;margin:0;padding:6px;gap:4px;border:1px solid var(--line);border-radius:var(--ui-radius-control);background:var(--panel);box-shadow:var(--ui-surface-shadow);z-index:10;overflow:visible}
html.messenger-desktop .conversation #chat-room-tools .actions button::after,
.chat-popout .conversation #chat-room-tools .actions button::after{content:none!important}
html .conversation #message-form.composer>.actions button{white-space:nowrap;min-width:0;padding-inline:9px}
/* 2026-11-13 대화 목록 정리(사용자 요청): PC·앱 같은 모양.
   - 줄 간격을 좁혀 한 화면에 더 많은 대화방, 줄마다 아래 가로선(앱도 PC처럼), 구역 사이 이중선 없앰
   - 다크모드에서 필터 띠와 목록 바탕을 같은 색으로
   - PC 웹도 Windows 앱처럼 점 세 개는 마우스를 올렸을 때만 줄 위에 겹쳐 보임(따로 칸을 차지하지 않음)
   - 터치 기기: 말풍선 위 버튼 묶음은 숨기고 꾹 누르기 메뉴·스와이프 답장만 쓴다 */
.chat-layout .room-list,.room-list>.chat-filter-bar{background:var(--panel)}
.chat-room-section+.chat-room-section{border-top:0}
.chat-room-section h3{padding:12px 14px 4px}
.room-list .room-row{position:relative;display:block!important;border-bottom:1px solid var(--line)}
.room-list .room-row .room-item{border-bottom:0!important;border-radius:0;min-height:0!important;padding:9px 14px!important;padding-right:14px!important;gap:10px}
.room-list .room-item .room-avatar-stack,.room-list .room-item .room-avatar-stack:not(.room-group-avatar) .person-avatar{width:40px!important;height:40px!important;flex-basis:40px}
.room-list .room-item>.room-title-avatar{width:40px;height:40px;flex:0 0 40px;font-size:12px}
.room-list .room-item .room-group-avatar{grid-template-columns:repeat(2,19px)}
.room-list .room-item .room-group-avatar .person-avatar{width:19px!important;height:19px!important}
.room-list .room-item .room-label{font-size:14px}
.room-list .room-item .room-preview{font-size:12px}
@media(min-width:701px) and (hover:hover){
 .room-list .room-row .room-more{position:absolute!important;right:6px;top:50%;transform:translateY(-50%);width:30px;height:30px;min-height:30px;min-width:0;padding:6px;margin:0;opacity:0;border-radius:var(--ui-radius-control);background:var(--soft)}
 .room-list .room-row:hover .room-more,.room-list .room-row:focus-within .room-more,.room-list .room-row .room-more[aria-expanded=true]{opacity:1}
 .room-list .room-row:hover .room-item{background:var(--soft)}
}
@media(max-width:700px){
 .chat-layout .room-list{padding:0!important}
 .room-list .room-row .room-item{padding:9px 12px!important;min-height:0!important}
}
@media(hover:none),(pointer:coarse){.messages .message-action-buttons{display:none!important}}
.chat-composer-toolbar [data-format-toggle],[data-format-toggle]{white-space:nowrap;min-width:34px;flex:0 0 auto;writing-mode:horizontal-tb}
#content .room-list>.chat-filter-bar{flex-wrap:wrap!important}
.room-list>.chat-filter-bar>:not([data-chat-filter]){flex:1 1 100%;order:2}
#content .room-list>.chat-filter-bar [data-chat-filter]{background:transparent;border:1px solid var(--line);color:var(--muted)}
#content .room-list>.chat-filter-bar [data-chat-filter][aria-pressed=true]{background:var(--ui-selected-bg);border-color:var(--ui-selected-bg);color:var(--ui-selected-text);font-weight:700}
