/* Strictly scoped to messaging: existing navy/blue branding, phone-style conversations. */
.msg-shell{--chat-bg:#071625;--chat-panel:#0b2034;--chat-line:#233e53;--chat-muted:#a7bdcf;--chat-blue:#087bea;background:var(--chat-bg);color:#f5f9ff;border:1px solid var(--chat-line);border-radius:22px;overflow:hidden;display:grid;grid-template-columns:minmax(250px,32%) minmax(0,1fr);height:min(740px,calc(100dvh - 130px));min-height:450px;max-width:1240px;margin:12px auto;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:16px;line-height:1.45;text-align:left;box-sizing:border-box}
.msg-shell *{box-sizing:border-box}.msg-shell button,.msg-shell textarea,.msg-shell input{font:inherit}.msg-shell button{cursor:pointer}.msg-shell button:focus-visible,.msg-shell input:focus-visible,.msg-shell textarea:focus-visible{outline:3px solid #6ccbff;outline-offset:-3px}.msg-inbox{min-width:0;display:flex;flex-direction:column;background:#0b1c2d;border-right:1px solid var(--chat-line);overflow:hidden}.msg-inbox-head{padding:22px 18px 16px}.msg-inbox-head h2{font-size:27px;margin:0;font-weight:750;letter-spacing:-.6px}.msg-inbox-head p{color:var(--chat-muted);font-size:13px;margin:5px 0 16px}.msg-inbox-head input{width:100%;border:0;background:#172e43;color:white;border-radius:12px;padding:12px;margin:0 0 14px;min-width:0}.msg-inbox-head input::placeholder{color:#a7bdcf}.msg-tabs{display:flex;gap:4px}.msg-tabs button{background:transparent;color:#becfdd;border:0;border-radius:18px;padding:8px 11px;font-size:13px;min-height:40px;flex:1}.msg-tabs button[aria-pressed=true]{background:#087bea;color:white}.msg-thread-list{overflow:auto;overscroll-behavior:contain;flex:1}.msg-thread{display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:inherit;padding:16px;text-align:left;min-height:85px;border-radius:0}.msg-thread:hover,.msg-thread.selected{background:#123852}.msg-avatar{display:flex;align-items:center;justify-content:center;flex:none;width:43px;height:43px;border-radius:50%;background:#164f7c;color:#9ee0ff;font-size:15px;font-weight:750}.msg-thread-copy{min-width:0;flex:1}.msg-thread-copy strong{display:block;font-size:15px;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.msg-thread-copy>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--chat-muted);font-size:13px;line-height:1.4}.msg-thread-edge{align-self:stretch;display:flex;align-items:flex-end;flex-direction:column;gap:9px;white-space:nowrap}.msg-thread-edge time{font-size:11px;color:var(--chat-muted)}.msg-unread{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;border-radius:12px;padding:0 6px;background:#dc2945;color:white;font-size:11px;line-height:1;font-weight:700;margin-left:4px}.msg-conversation{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.msg-chat-head{display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--chat-line);background:#0d2134;flex:none}.msg-chat-head h3{font-size:17px;margin:0;line-height:1.3}.msg-chat-head p{font-size:12px;color:var(--chat-muted);margin:3px 0 0}.msg-back{border:0;background:transparent;color:#a1d8ff;font-size:34px!important;line-height:1;width:32px;min-height:44px;padding:0;display:none}.msg-feed{flex:1;min-height:120px;overflow:auto;overscroll-behavior:contain;padding:18px 22px;scrollbar-gutter:stable;overflow-wrap:anywhere}.msg-date{text-align:center;font-size:11px;letter-spacing:.4px;color:#aac1d3;padding:12px 0 20px}.msg-line{display:flex;margin:13px 0 0;border:0!important;padding:0!important;background:none!important;min-width:0}.msg-line.is-sent{justify-content:flex-end}.msg-line.is-received{justify-content:flex-start}.msg-line.consecutive{margin-top:4px}.msg-bubble{max-width:82%;border-radius:18px 18px 18px 5px;background:#1b344a;padding:11px 15px;box-shadow:0 1px 0 #0002;min-width:85px}.is-sent .msg-bubble{background:#0868be;border-radius:18px 18px 5px 18px}.msg-sender{font-size:11px;font-weight:750;color:#a8dcff;margin-bottom:4px}.is-sent .msg-sender{color:#d6edff}.msg-bubble p{font-size:16px;line-height:1.5;margin:0!important;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.msg-meta{font-size:10px;color:#b8ccdc;text-align:right;margin-top:5px}.is-sent .msg-meta{color:#d2e6f8}.msg-receipt{background:transparent;border:0!important;padding:8px 8px 2px 0;color:#c2e9ff;font-size:11px!important;min-height:32px}.msg-receipt:disabled{opacity:.65;cursor:default}.msg-compose{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:12px 16px;background:#0d2134;border-top:1px solid var(--chat-line);margin:0!important}.msg-compose label,.msg-compose #scReplyCancel{grid-column:1/-1;color:var(--chat-muted);font-size:12px;font-weight:500}.msg-compose textarea,#screen-messages .msg-compose #scMessageText{min-height:46px!important;max-height:120px;width:100%;resize:vertical;border:1px solid #345068;border-radius:18px;background:#142c40;color:white;padding:12px;margin:0;font-size:16px!important;line-height:1.4}.msg-send,#screen-messages .msg-compose #scSend{border:0;border-radius:22px;color:#fff;background:#087bea;width:auto;min-width:64px;min-height:46px;margin:0;padding:10px 15px;font-size:14px;font-weight:700}.msg-send:disabled{opacity:.55;cursor:default}.msg-save{grid-column:1/-1;font-size:12px;min-height:0;color:#b0d5ee;padding:0 3px}.msg-save:empty{display:none}.msg-empty{margin:auto;text-align:center;color:#9db6ca;padding:30px;font-size:17px;line-height:1.8}.msg-empty small{font-size:13px}.msg-broadcast-compose{background:#10283c;max-height:55%;overflow:auto;padding:12px}.msg-broadcast-compose summary{cursor:pointer;color:#8ed6ff;font-weight:700;padding:5px}.msg-broadcast-compose>p{font-size:12px;color:var(--chat-muted)}.msg-broadcast-compose button{border:1px solid #34566c;border-radius:8px;padding:7px 12px;background:#19394f;color:white;font-size:12px;margin:3px}.msg-broadcast-compose .msg-send{background:#087bea}.msg-audience{display:flex}.msg-targets{max-height:135px;overflow:auto;display:grid;grid-template-columns:1fr 1fr;margin:10px 0}.msg-targets label{font-size:13px;display:flex;gap:8px;padding:6px}.msg-targets input{width:18px;height:18px}.msg-visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#screen-messages>.screen-head{display:none}#screen-messages>.page{padding:0;max-width:none}#screen-messages>.page>.card{padding:0;background:transparent;border:0;box-shadow:none}#screen-messages>.page>.card>.section-title{display:none}#scMessages.msg-shell{width:100%;margin:0 auto}#screen-messages #scMessageForm[hidden]{display:none!important}.msg-compose[hidden]{display:none!important}
@media(min-width:701px){.msg-conversation .msg-back{display:block}}
@media(max-width:700px){.msg-shell{display:block;height:calc(100dvh - 108px);min-height:380px;border-radius:16px;margin:6px 0}.msg-inbox{height:100%;border:0}.msg-conversation{display:none;height:100%}.msg-shell.has-conversation .msg-inbox{display:none}.msg-shell.has-conversation .msg-conversation{display:flex}.msg-back{display:block}.msg-chat-head{padding:12px}.msg-feed{padding:12px}.msg-bubble{max-width:88%;padding:10px 13px}.msg-compose{padding:10px;gap:6px;padding-bottom:max(10px,env(safe-area-inset-bottom))}.msg-inbox-head{padding:20px 16px 12px}.msg-thread{min-height:88px}.msg-targets{grid-template-columns:1fr}.msg-shell .msg-chat-head h3{font-size:16px}}
/* The student app is intentionally a phone-width application on desktop too. */
#scMessages.msg-shell{display:block}#scMessages .msg-inbox{height:100%;border-right:0}#scMessages .msg-conversation{display:none;height:100%}#scMessages.has-conversation .msg-inbox{display:none}#scMessages.has-conversation .msg-conversation{display:flex}#scMessages .msg-back{display:block}.msg-conversation{position:relative}.msg-latest{position:absolute;bottom:125px;right:24px;z-index:2;border:1px solid #4d95c0;border-radius:20px;background:#143e59;color:#e7f7ff;font-size:12px!important;padding:9px 14px;box-shadow:0 3px 10px #0006}.msg-latest[hidden]{display:none}
/* Keep the existing branding visible, compact only while an instructor chat is open. */
body:has(#screen .msg-shell) .approvedHeaderContent .brandHero{height:64px;min-height:0;padding:0;margin:6px 0}body:has(#screen .msg-shell) .approvedHeaderContent .brandPhoto{display:none}body:has(#screen .msg-shell) .approvedHeaderContent .brandPhotoTitle{padding:10px;text-align:center}body:has(#screen .msg-shell) .approvedHeaderContent .brandPhotoTitle strong{font-size:18px}body:has(#screen .msg-shell) .approvedHeaderContent .brandPhotoTitle span{font-size:10px}body:has(#screen .msg-shell) .approvedSharedHeader #backTop{bottom:14px}#screen:has(.msg-shell){padding-bottom:88px}#screen .msg-shell{height:calc(100dvh - 240px);min-height:380px}#screen .footerNote:has(~ .msg-shell){display:none}
@media(max-width:700px){#screen .msg-shell{height:calc(100dvh - 245px);min-height:380px}.msg-latest{right:14px}}
.msg-feed,.msg-thread-list,.msg-targets{scrollbar-width:thin;scrollbar-color:#355970 transparent}.msg-feed::-webkit-scrollbar,.msg-thread-list::-webkit-scrollbar{width:5px}.msg-feed::-webkit-scrollbar-thumb,.msg-thread-list::-webkit-scrollbar-thumb{background:#355970;border-radius:6px}.msg-shell{max-height:none}

/* Instructor broadcasts: independently sized recipients, history and composer. */
#screen .msg-shell.msg-staff{min-height:0}
.msg-staff .msg-feed{min-height:0;flex:1 1 0;overflow:auto;-webkit-overflow-scrolling:touch}
.msg-staff .msg-broadcast-compose{flex:0 0 auto;max-height:none;overflow:visible;padding:7px 12px;border-bottom:1px solid var(--chat-line)}
.msg-staff .msg-broadcast-compose summary{min-height:36px;display:list-item;line-height:26px}
.msg-staff .msg-recipient-options{max-height:clamp(70px,calc(var(--msg-chat-height,600px)*.25),170px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.msg-staff .msg-recipient-options>p{font-size:12px;color:var(--chat-muted);margin:5px 0}
.msg-staff .msg-targets{max-height:none;overflow:visible}
.msg-staff .msg-targets label{min-height:40px;align-items:center;overflow-wrap:anywhere}
.msg-staff .msg-compose{position:relative;flex:0 0 auto;z-index:1}
.msg-staff .msg-latest{bottom:calc(var(--msg-compose-height,96px) + 8px)}
.msg-staff.msg-compact-viewport .msg-chat-head{padding:6px 10px}
.msg-staff.msg-compact-viewport .msg-chat-head p{display:none}
.msg-staff.msg-compact-viewport .msg-compose{padding:6px 10px}
.msg-staff.msg-compact-viewport .msg-broadcast-compose{padding-block:2px}
