/* Community feed floating messaging drawer. Loaded only by the feed route. */
.msg-drawer-container{position:fixed;right:16px;bottom:0;z-index:9999;display:flex;flex-direction:column;width:min(320px,calc(100vw - 32px));height:48px;overflow:hidden;border:1px solid var(--border);border-bottom:0;border-radius:8px 8px 0 0;background:var(--surface);box-shadow:0 0 16px rgb(17 32 38 / 16%);color:var(--text);transition:height .3s ease-in-out}
.msg-drawer-container.is-expanded{height:min(520px,calc(100dvh - 24px))}
.msg-drawer-header{display:flex;flex:0 0 47px;align-items:center;justify-content:space-between;gap:8px;min-height:47px;padding:4px 9px 4px 12px;border-bottom:1px solid transparent;cursor:pointer}
.msg-drawer-container.is-expanded .msg-drawer-header{border-bottom-color:var(--border)}
.msg-drawer-identity{display:flex;align-items:center;gap:9px;min-width:0;color:var(--text);text-decoration:none}
.msg-drawer-identity strong{overflow:hidden;font-size:.88rem;text-overflow:ellipsis;white-space:nowrap}
.msg-drawer-avatar{position:relative;display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;overflow:hidden;border:1px solid var(--border);border-radius:50%;background:var(--accent-light);color:var(--accent);font-size:.78rem;font-weight:750}
.msg-drawer-avatar img{width:100%;height:100%;object-fit:cover}
.msg-drawer-actions{display:flex;align-items:center;gap:1px}
.msg-drawer-action{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);text-decoration:none;cursor:pointer}
.msg-drawer-action:hover:not(:disabled){background:var(--surface-raised);color:var(--text)}
.msg-drawer-action:disabled{cursor:not-allowed;opacity:.55}
.msg-drawer-action .ui-icon{width:18px;height:18px}
.msg-drawer-toggle svg{transition:transform .25s ease}
.msg-drawer-container.is-expanded .msg-drawer-toggle svg{transform:rotate(180deg)}
.msg-drawer-body{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;opacity:0;transition:opacity .18s ease}
.msg-drawer-container.is-expanded .msg-drawer-body{opacity:1}
.msg-drawer-search{display:flex;align-items:center;gap:8px;min-height:38px;margin:10px 11px 6px;padding:0 10px;border:1px solid transparent;border-radius:7px;background:var(--surface-raised)}
.msg-drawer-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
.msg-drawer-search>.ui-icon{width:17px;height:17px;color:var(--muted)}
.msg-drawer-search input{width:100%;min-width:0;height:35px;padding:0;border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:.82rem}
.msg-drawer-search button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted)}
.msg-drawer-search button[hidden]{display:none}
.msg-drawer-search button .ui-icon{width:16px;height:16px}
.msg-drawer-tabs{display:flex;gap:7px;padding:2px 12px 9px;border-bottom:1px solid var(--border)}
.msg-drawer-tabs button{min-height:30px;padding:5px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font:650 .74rem/1.2 var(--font);cursor:pointer}
.msg-drawer-tabs button.is-active{border-color:var(--accent);background:var(--accent);color:#fff}
.msg-drawer-tabs button:disabled{cursor:not-allowed;opacity:.55}
.msg-drawer-list{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.msg-drawer-list .conversation-list{display:grid;max-height:none;padding:0}
.msg-drawer-list .conversation-entry{position:relative;border-bottom:1px solid var(--border)}
.msg-drawer-list a.conversation-row{min-height:68px;padding:9px 12px;border:0}
.msg-drawer-list .conversation-options,.msg-drawer-list .conversation-pagination{display:none}
.msg-drawer-list .conversation-row:hover{background:var(--surface-raised)}
.msg-drawer-list .conversation-preview{max-width:208px}
.msg-drawer-list .conversation-summary{min-width:0}
.msg-drawer-list .msg-drawer-empty,.msg-drawer-fallback{margin:0;padding:24px 14px;color:var(--muted);font-size:.82rem;text-align:center}
.msg-drawer-empty a,.msg-drawer-fallback a{color:var(--accent);font-weight:650}
.msg-drawer-retry{display:block;margin:22px auto;padding:8px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--accent);font:600 .78rem var(--font);cursor:pointer}
.msg-drawer-loading,.msg-chat-loading{display:flex;align-items:center;justify-content:center;gap:10px;min-height:100px;color:var(--muted);font-size:.8rem}
.msg-spinner{width:20px;height:20px;border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;animation:msg-spin .7s linear infinite}
@keyframes msg-spin{to{transform:rotate(360deg)}}
.msg-chat-skeleton{display:grid;align-content:center;gap:16px;height:100%;padding:24px}
.msg-chat-skeleton .ui-skeleton{height:42px;width:72%;border-radius:16px}
.msg-chat-skeleton .ui-skeleton:nth-child(2){width:54%;margin-left:auto}
.msg-chat-skeleton .ui-skeleton:nth-child(3){width:64%}
.msg-chat-popup{position:fixed;right:324px;bottom:0;z-index:9998;width:min(380px,calc(100vw - 356px));height:min(520px,calc(100dvh - 24px));overflow:hidden;border:1px solid var(--border);border-bottom:0;border-radius:8px 8px 0 0;background:var(--surface);box-shadow:0 0 18px rgb(17 32 38 / 18%);color:var(--text)}
.msg-chat-popup[hidden]{display:none!important}
.msg-chat-content,.msg-chat-content>.message-thread-panel{display:flex;width:100%;height:100%;min-height:0;flex-direction:column}
.msg-chat-content>.message-thread-panel{border:0;border-radius:0;box-shadow:none}
.msg-chat-content .message-thread-header{flex:0 0 auto;min-height:54px;padding-right:48px}
.msg-chat-content .message-history{flex:1 1 auto;min-height:0;max-height:none;padding:10px}
.msg-chat-content .message-composer{flex:0 0 auto;margin:8px;padding:8px}
.msg-chat-content .message-compose-text{min-height:54px;max-height:100px}
.msg-chat-close{position:absolute;top:9px;right:9px;z-index:2;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--muted);cursor:pointer}
.msg-chat-close:hover{background:var(--surface-raised);color:var(--text)}
body:not(.admin-app) .msg-drawer-container,body:not(.admin-app) .msg-chat-popup{border-color:var(--border);border-radius:16px 16px 0 0;box-shadow:var(--shadow-lg)}
body:not(.admin-app) .msg-drawer-tabs button{min-height:34px}
html[data-theme] .rose-community-ui .msg-drawer-container{border-color:var(--border-color);background:var(--bg-card);box-shadow:var(--shadow-lg)}
html[data-theme] .rose-community-ui .msg-drawer-header{border-color:color-mix(in srgb,var(--accent-contrast) 22%,transparent);background:linear-gradient(110deg,var(--accent-gradient-from),var(--accent-gradient-to));color:var(--accent-contrast)}
html[data-theme] .rose-community-ui .msg-drawer-header .msg-drawer-action{color:var(--accent-contrast)}
html[data-theme] .rose-community-ui .msg-drawer-header .msg-drawer-avatar{border-color:color-mix(in srgb,var(--accent-contrast) 70%,transparent)}
html[data-theme] .msg-chat-popup .btn-primary{border-color:var(--accent);background:var(--accent);color:var(--accent-contrast)}
html[data-theme] .msg-chat-popup .btn-primary:hover{border-color:var(--accent-hover);background:var(--accent-hover)}
html[data-theme] .msg-drawer-tabs button.is-active{border-color:var(--accent);background:var(--accent);color:var(--accent-contrast)}
@media(max-width:767.98px){.msg-drawer-container,.msg-chat-popup{display:none!important}body.mobile-nav-open .msg-drawer-container{visibility:hidden;pointer-events:none}.rose-community-ui .msg-drawer-container{display:flex!important;right:8px;bottom:calc(62px + env(safe-area-inset-bottom));width:min(360px,calc(100vw - 16px));max-height:calc(100dvh - 82px - env(safe-area-inset-bottom));border:1px solid var(--border);border-radius:15px 15px 0 0;box-shadow:0 12px 40px rgb(38 18 24 / 20%)}.rose-community-ui .msg-drawer-container.is-expanded{height:min(62dvh,560px)}.rose-community-ui .msg-chat-popup{right:8px;bottom:calc(110px + env(safe-area-inset-bottom));z-index:10000;width:min(360px,calc(100vw - 16px));height:min(62dvh,560px);border-radius:15px;box-shadow:0 12px 40px rgb(38 18 24 / 24%)}.rose-community-ui .msg-drawer-list{overscroll-behavior:contain}}
@media(max-width:380px){.rose-community-ui .msg-drawer-container{width:min(232px,calc(100vw - 20px))}}
@media(min-width:768px) and (max-width:991.98px){body:not(.admin-app) .msg-drawer-container{display:flex!important;right:10px;bottom:calc(62px + env(safe-area-inset-bottom));width:min(258px,calc(100vw - 20px));height:48px;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-md)}body:not(.admin-app) .msg-drawer-container.is-expanded{height:min(62dvh,520px)}body:not(.admin-app) .msg-chat-popup{display:block!important;right:10px;bottom:calc(116px + env(safe-area-inset-bottom));width:calc(100vw - 20px);height:min(58dvh,480px);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-lg)}body:not(.admin-app) .msg-chat-popup[hidden]{display:none!important}}
@media(max-width:767.98px){.rose-community-ui .msg-drawer-container{right:0;bottom:0;width:100%;max-width:100%;height:56px;max-height:calc(100dvh - env(safe-area-inset-top));border:1px solid var(--border);border-bottom:0;border-radius:20px 20px 0 0;box-shadow:0 -8px 34px rgb(38 18 24 / 17%)}.rose-community-ui .msg-drawer-container.is-expanded{height:min(74dvh,650px);max-height:calc(100dvh - env(safe-area-inset-top))}.rose-community-ui .msg-drawer-header{min-height:55px;flex-basis:55px;padding-inline:14px}.rose-community-ui .msg-drawer-action{width:44px;height:44px;min-width:44px;min-height:44px}.rose-community-ui .msg-chat-popup{right:0;bottom:0;width:100%;max-width:100%;height:min(86dvh,760px);border:1px solid var(--border);border-bottom:0;border-radius:20px 20px 0 0}.rose-community-ui .msg-chat-close{top:8px;right:10px;width:44px;height:44px}.msg-drawer-search input{min-height:44px}.msg-drawer-tabs button,.msg-drawer-list .conversation-row{min-height:48px}}
@media(prefers-reduced-motion:reduce){.msg-drawer-container,.msg-drawer-body,.msg-drawer-toggle svg{transition:none}.msg-spinner{animation:none}}
