/* Full-page participant-private messaging, shared by both account roles. */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
body.messaging-mode .sitefoot { display:none; }
body.messaging-mode #app { width:100%;max-width:none;padding:0;height:calc(100dvh - 88px);min-height:480px; }
body.messaging-mode .msg-workspace { border:0;border-radius:0;box-shadow:none; }
body.messaging-thread .topbar,body.messaging-thread .tabbar { display:none; }
body.messaging-thread #app { height:100dvh;padding-top:env(safe-area-inset-top,0px); }


.msg-workspace { height:100%;display:grid;grid-template-columns:330px minmax(0,1fr);background:#fff;border:1px solid #dfe6f0;border-radius:18px;overflow:hidden;box-shadow:0 8px 30px rgba(10,31,68,.04); }
.msg-sidebar { min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid #e5eaf2; }
.msg-sidebar-head { padding:26px 22px 18px; }
.msg-eyebrow { text-transform:uppercase;letter-spacing:.1em;color:#64748e;font-size:10px;font-weight:700; }
.msg-sidebar h1 { margin:5px 0 20px;font-size:28px;letter-spacing:-.035em; }
.msg-search input { display:block;width:100%;height:44px;padding:10px 14px;border:1px solid #e1e7f0;border-radius:10px;background:#f6f8fc;color:#0a1f44;font:inherit; }
.msg-status { font-size:13px;color:#69768b;line-height:1.55;padding:0 22px 10px; }
.msg-status:empty { display:none; }
.msg-list { overflow-y:auto;min-height:0;padding:0 10px 16px; }
.msg-contact { display:flex;align-items:center;gap:12px;min-height:90px;padding:16px 12px;text-decoration:none;border-radius:12px; }
.msg-contact:hover { background:#f6f8fc; }
.msg-contact.selected { background:#eaf1ff; }
.msg-avatar-img { width:100%;height:100%;object-fit:cover; }
.msg-avatar { display:flex;align-items:center;justify-content:center;flex:none;width:46px;height:46px;border-radius:50%;background:#edf2fb;color:#246bfd;font-weight:750;overflow:hidden; }
.msg-contact-content { display:block;min-width:0;flex:1; }
.msg-contact-top { display:flex;align-items:baseline;justify-content:space-between;gap:8px; }
.msg-contact-top strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px; }
.msg-contact-top time { white-space:nowrap;color:#7a879b;font-size:10px; }
.msg-snippet { display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:12px;color:#68778f;margin-top:6px; }
.msg-main { min-height:0;min-width:0;display:flex;flex-direction:column;background:linear-gradient(#fff,#fbfcff); }
.msg-welcome { margin:auto;padding:48px;text-align:center;max-width:470px; }
.msg-welcome-icon { display:flex;align-items:center;justify-content:center;margin:0 auto 20px;background:#eaf1ff;border-radius:22px;width:80px;height:80px;color:#246bfd; }
.msg-welcome-icon svg { width:36px;height:36px; }
.msg-welcome h2 { font-size:27px;letter-spacing:-.03em;line-height:1.2; }
.msg-welcome p { color:#69778d;font-size:15px;line-height:1.6;margin-bottom:24px; }
.msg-thread-head { min-height:90px;padding:18px 28px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #e8edf4; }
.msg-thread-head h2 { margin:0;font-size:18px;letter-spacing:-.025em; }
.msg-thread-head p { margin:4px 0 0;color:#758198;font-size:11px; }
.msg-back { display:none;align-items:center;justify-content:center;min-width:40px;min-height:44px;text-decoration:none;font-size:24px; }
.msg-history { min-height:0;flex:1;overflow-y:auto;padding:24px 28px;overscroll-behavior:contain; }
.msg-empty { margin:64px auto;text-align:center;max-width:320px;color:#738097;font-size:14px;line-height:1.6; }
.msg-day { text-align:center;font-size:10px;color:#8791a2;margin:0 0 20px; }
.msg-message { display:flex;margin-bottom:14px; }
.msg-message.mine { justify-content:flex-end; }
.msg-bubble { max-width:75%;background:#eff3f9;color:#162c4e;border-radius:16px 16px 16px 4px;padding:12px 15px;overflow-wrap:anywhere; }
.mine .msg-bubble { background:#246bfd;color:#fff;border-radius:16px 16px 4px 16px; }
.msg-bubble p { margin:0;white-space:pre-wrap;line-height:1.55;font-size:14px; }
.msg-bubble time { display:block;opacity:.65;text-align:right;margin-top:6px;font-size:9px; }
.msg-compose { display:flex;align-items:flex-end;gap:12px;padding:14px 24px 8px;margin:0; }
.msg-add { width:44px;height:44px;display:flex;align-items:center;justify-content:center;flex:none;background:#edf3ff;color:#246bfd;border:0;border-radius:50%;font-size:28px;font-weight:400; }
.msg-compose textarea { flex:1;min-width:0;border:1px solid #dfe5ef;border-radius:14px;background:#fff;padding:12px 14px;font:inherit;font-size:16px;resize:none;line-height:1.4;max-height:140px;min-height:46px;color:#0a1f44; }
.msg-compose .btn { min-height:46px; }
.msg-compose-note { color:#7d899c;font-size:10px;line-height:1.5;margin:0;padding:0 26px 16px 82px;min-height:32px; }
.msg-preview { display:flex;align-items:center;gap:12px;margin:8px 24px 0;padding:12px;border:1px solid #dce6f4;border-radius:12px;font-size:12px;color:#68778f; }
.msg-preview[hidden] { display:none; }
.msg-preview img { width:60px;height:60px;object-fit:cover;border-radius:8px; }
.msg-preview button { margin-left:auto;width:40px;height:40px;background:#f2f5fa;border:0;border-radius:8px;font-size:24px;color:#0a1f44; }
.msg-photo-load { border:1px solid currentColor;border-radius:10px;padding:24px;color:inherit;background:transparent;font-size:14px;min-height:70px;min-width:150px; }
.msg-photo { max-width:100%;width:auto;max-height:400px;object-fit:contain;border-radius:8px; }
.msg-workspace a:focus-visible,.msg-workspace button:focus-visible,.msg-workspace input:focus-visible,.msg-workspace textarea:focus-visible { outline:3px solid #246bfd;outline-offset:2px; }
.msg-workspace button:disabled { opacity:.55;cursor:default; }
@media (max-width:1023px) {
 body.messaging-mode #app { height:calc(100dvh - 123px);padding:0;min-height:360px; }
 body.messaging-thread #app { height:100dvh; }
 .msg-workspace { grid-template-columns:280px minmax(0,1fr); }
 .msg-sidebar-head { padding:20px 16px 14px; }
 .msg-thread-head { padding:16px; }
 .msg-history { padding:20px 16px; }
 .msg-compose { padding:12px 14px 8px;gap:8px; }
 .msg-compose-note { padding-left:14px;padding-right:14px; }
}
@media (max-width:699px) {
 body.messaging-mode #app { height:calc(100dvh - 118px);min-height:320px;padding:0; }
 body.messaging-thread #app { height:100dvh; }
 .msg-workspace { display:flex;border:0;border-radius:0;box-shadow:none; }
 .msg-sidebar { width:100%;border:0; }
 .msg-sidebar-head { padding:22px 18px 14px; }
 .msg-sidebar h1 { margin-bottom:18px;font-size:30px; }
 .msg-list { padding:0 8px 16px; }
 .msg-workspace:not(.has-thread) .msg-main { display:none; }
 .msg-workspace.has-thread .msg-sidebar { display:none; }
 .msg-workspace.has-thread .msg-main { width:100%; }
 .msg-back { display:flex; }
 .msg-thread-head { min-height:76px;padding:10px 12px 10px 4px; }
 .msg-thread-head .msg-avatar { width:38px;height:38px; }
 .msg-thread-head h2 { font-size:17px; }
 .msg-bubble { max-width:86%; }
 .msg-compose { padding-bottom:8px; }
 .msg-compose .btn { padding-left:16px;padding-right:16px; }
 .msg-add { width:42px;height:44px; }
 .msg-compose-note { padding-bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
 
 
}

/* Readable participant header, thumb-reachable back, and device-safe edges. */
body.messaging-thread { background:#f6f8fc; }
body.messaging-thread #app { box-sizing:border-box;height:100dvh;min-height:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:0; }
.msg-peer { display:flex;align-items:center;gap:12px;min-width:0;flex:1;text-align:left;border:0;background:transparent;color:inherit;padding:4px;border-radius:12px;cursor:pointer;font:inherit; }
.msg-peer:disabled { cursor:default;opacity:1!important; }
.msg-peer-info { display:block;min-width:0; }
.msg-peer-name { display:block;font-size:17px;font-weight:750;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%; }
.msg-peer-sub { display:block;font-size:12px;color:#64748b;margin-top:3px; }
.msg-thread-head { flex:none;background:#fff;min-width:0;box-shadow:0 2px 10px #10244805;z-index:1; }
.msg-main { background:#f7f9fd; }
.msg-history { padding-top:22px; }
.msg-day { width:max-content;margin:0 auto 22px;padding:5px 12px;border-radius:20px;background:#eaf0f7;color:#60718b;font-size:11px; }
.msg-bubble { box-shadow:0 2px 5px #10244805; }
.theirs .msg-bubble { background:#fff;border:1px solid #e5eaf2; }
.msg-bubble p { font-size:15px;line-height:1.5; }
.msg-bubble time { font-size:10px;opacity:.8; }
.msg-compose { background:#fff;border-top:1px solid #e5eaf2;padding-top:12px;padding-bottom:8px;flex:none; }
.msg-compose textarea { border-radius:22px;background:#f8faff;min-height:46px; }
.msg-compose-note { background:#fff;min-height:0;font-size:12px;padding:0 24px 8px;color:#52647d; }
.msg-compose-note:empty { display:none; }
.msg-bottom-nav { flex:none;background:#fff;display:flex;align-items:center;justify-content:flex-start;padding:0 20px calc(8px + env(safe-area-inset-bottom,0px)); }
.msg-bottom-back { display:inline-flex;align-items:center;gap:8px;min-height:44px;border-radius:10px;padding:0 10px;text-decoration:none;color:#243d68;font-size:13px;font-weight:650; }
.msg-bottom-back:hover { background:#f1f4fa; }
.msg-profile-card { border:1px solid #dfe6f0;border-radius:20px;padding:28px;max-width:380px;width:calc(100% - 32px);box-sizing:border-box;color:#162c4e; }
.msg-profile-card::backdrop { background:#10244866; }
.msg-profile-avatar { width:68px;height:68px;font-size:24px; }
.msg-profile-card h2 { margin:16px 0 10px; }
.msg-profile-card p { line-height:1.55; }
@media(max-width:699px) {
 .msg-thread-head { padding:10px 14px 10px 8px;min-height:76px;gap:4px; }
 .msg-thread-head .msg-avatar { width:44px;height:44px; }
 .msg-peer { gap:10px; }
 .msg-peer-name { font-size:16px; }
 .msg-history { padding:18px 14px; }
 .msg-compose { padding:10px 12px 6px; }
 .msg-compose-note { padding:0 16px 8px; }
 .msg-bottom-nav { padding-left:8px;padding-right:8px; }
 .msg-compose .btn { padding-left:18px;padding-right:18px; }
 .msg-bubble { max-width:86%; }
}
