/* DES-1e: small additions on top of the approved v2.3.21 Messages look (comms.css). Nothing here restyles the design. */
.comms .pane-header h2 .unread{display:inline-block;margin:0 0 0 8px;padding:1px 8px;font:700 12px/18px var(--ui);vertical-align:middle}
.comms .row-meta{display:flex;flex-direction:column;align-items:flex-end}
.comms .row-meta .unread{display:inline-flex;align-items:center;justify-content:center;align-self:flex-end;min-width:32px;min-height:22px;width:auto;height:auto;padding:2px 10px;box-sizing:border-box;border-radius:999px;background:var(--brand);color:var(--canvas);line-height:18px;white-space:nowrap;margin-top:6px}
.comms .row-copy span.is-unread{color:var(--ink);font-weight:600}
.comms .tick{margin-left:4px}
.comms .tick.fail{color:var(--accent-ink);font-weight:600}
.comms .bubble-wrap.failed .bubble{border-color:var(--accent)}
.comms .bubble-wrap.sending .bubble{opacity:.78}
.comms .bubble-actions button.retry{border-color:var(--accent);color:var(--accent-ink)}
.comms .tag-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.comms .state-card{margin:12px 0}
.comms .menu-list{display:grid;gap:4px;margin-bottom:12px}
.comms .menu-list button{justify-content:flex-start;gap:12px;width:100%}
.comms .invite-box{display:grid;gap:8px;margin:8px 0}

:root{--test-top-height:36px;--test-bottom-height:36px}
.test-top{background:#dcc27a;color:#14202e;padding:8px 16px;position:sticky;top:0;z-index:20;text-align:center;font:700 14px/20px system-ui,sans-serif}
.test-bottom{background:#b00020;color:white;padding:8px 16px calc(8px + env(safe-area-inset-bottom,0px));position:fixed;bottom:0;left:0;right:0;z-index:20;text-align:center;font:700 14px/20px system-ui,sans-serif}
.rail{top:var(--test-top-height);bottom:var(--test-bottom-height);height:auto}
.comms .svc-chip{display:inline-flex;width:auto;vertical-align:middle;white-space:nowrap;font:600 11px/16px var(--ui);padding:1px 6px;border:1px solid var(--line-2);border-radius:999px;color:var(--ink-2)}
.comms .row-copy .svc-chip{margin:3px 0}
.comms .bubble>.svc-chip{margin-bottom:4px}

/* The page accepts the shared header; these rules govern only the workspace. */
:root{--messages-bottom-tabs:0px;--messages-lane-top:180px}
body:has(#lane){height:100vh;height:100dvh;overflow:hidden;padding-bottom:0}
.page{padding:12px 22px 0;min-width:0}
#lane.comms{margin:0;min-width:0;display:flex;flex-direction:column;height:calc(100vh - var(--messages-lane-top) - var(--test-bottom-height) - var(--messages-bottom-tabs) - 8px);height:calc(100dvh - var(--messages-lane-top) - var(--test-bottom-height) - var(--messages-bottom-tabs) - 8px);overflow:hidden}
.comms .lane-title{flex:0 0 auto;flex-wrap:wrap;margin-bottom:8px;gap:8px}
.comms .lane-title>div{min-width:0}.comms .lane-title p{overflow-wrap:anywhere}
.comms .chat-layout{height:auto;min-height:0;flex:1;min-width:0;overflow:hidden;grid-template-columns:320px minmax(0,1fr)}
.comms .chat-screen{min-height:0;height:100%;overflow:hidden;flex-direction:column}
.comms .thread{min-height:0;min-width:0;flex:1 1 0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
.comms .composer{flex:0 0 auto;margin:0;padding:10px max(10px,env(safe-area-inset-right,0px)) 10px max(10px,env(safe-area-inset-left,0px))}
.comms .composer-row{flex-wrap:nowrap;min-width:0}.comms .composer textarea{min-width:0;flex:1;width:0}
.comms .composer-row>button{flex:0 0 44px}
.comms .conversation-list{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.comms .conversation-list>.pane-header,.comms .list-tools{flex:0 0 auto}
.comms #chatRows{min-height:0;overflow-y:auto;overflow-x:hidden}
.comms .bubble,.comms .secure,.comms .pane-header h2{overflow-wrap:anywhere}
.comms .bubble-actions{flex-wrap:wrap}.comms .status:empty{display:none}
@supports(height:100dvh){#lane.comms{height:calc(var(--messages-viewport-height,100dvh) - var(--messages-lane-top) - var(--test-bottom-height) - var(--messages-bottom-tabs) - 8px)}}
.comms button:disabled,.comms input:disabled,.comms textarea:disabled{opacity:.5;cursor:not-allowed}
.btabs{bottom:var(--test-bottom-height);padding-bottom:env(safe-area-inset-bottom,0px)}
@media(max-width:600px){
 :root{--messages-bottom-tabs:calc(76px + env(safe-area-inset-bottom,0px));--messages-lane-top:220px}
 .page{padding:8px 8px 0}.comms .chat-layout{display:block;min-height:0;height:auto}
 .comms .conversation-list{height:100%}.comms .chat-screen{display:none}
 .comms .thread-open .conversation-list{display:none}.comms .thread-open .chat-screen{display:flex}
 .comms .pane-header{min-height:60px;padding:8px;gap:6px}.comms .secure{padding:4px;font-size:12px}
 .comms .lane-title h1{font-size:22px}.comms .lane-title .subtle{font-size:12px}
}
