/* Shared school-green palette for chat and notifications. Same token as the school stripe. */
.comm-tools,.comm-topbar-tools,.comm-document-actions,#comm-dialog,.comm-photo-dialog{
 --comm-green:var(--accent-green,#36a852);
 --comm-ink:#173e22;
 --comm-action:#246f37;
 --comm-muted:#566c5a;
 --comm-line:color-mix(in srgb,var(--comm-green) 28%,white);
 --comm-soft:color-mix(in srgb,var(--comm-green) 10%,white);
 --comm-pale:color-mix(in srgb,var(--comm-green) 4%,white);
 --comm-bubble:color-mix(in srgb,var(--comm-green) 18%,white);
}
/* Isolated communication prototype; deliberately not part of production CSS. */
.comm-tools{display:flex;gap:8px;align-items:center}
.comm-document-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;max-width:100%}
body.financial-desk .comm-document-actions .comm-launch{width:auto;height:auto;flex:0 0 auto;white-space:nowrap}
body.financial-desk .comm-document-actions .comm-launch>span{white-space:nowrap}
body.financial-desk .comm-launch{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:9px 12px;background:#fff;border:1px solid var(--comm-line);border-radius:10px;color:var(--comm-ink);font:600 14px/1.3 inherit}
.comm-launch svg,.comm-drawer svg{width:22px;height:22px;flex-shrink:0}
.comm-count{background:#e63f5b;color:#fff;border-radius:10px;min-width:18px;height:18px;font-size:11px;display:grid;place-items:center}
body.comm-open{overflow:hidden}
dialog.comm-drawer{position:fixed;inset:16px 16px 16px auto;margin:0;width:510px;max-width:calc(100vw - 32px);height:calc(100dvh - 32px);max-height:none;padding:0;border:1px solid var(--comm-line);border-radius:18px;background:#fff;color:var(--comm-ink);box-shadow:0 18px 80px #10253f38;overflow:hidden;font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}
dialog.comm-drawer[open]{display:flex;flex-direction:column}
.comm-drawer::backdrop{background:#12294442;backdrop-filter:blur(2px)}
.comm-drawer *{box-sizing:border-box;min-width:0}
.comm-drawer button,.comm-drawer input,.comm-drawer select,.comm-drawer textarea{font:inherit}
.comm-drawer button{cursor:pointer;min-height:44px;border:1px solid var(--comm-line);background:#fff;border-radius:9px;padding:9px 12px;color:var(--comm-ink);white-space:normal}
.comm-drawer button:focus-visible,.comm-launch:focus-visible,.comm-drawer :is(input,select,textarea):focus-visible{outline:3px solid var(--comm-green);outline-offset:2px}
.comm-drawer button:hover{background:var(--comm-soft)}
.comm-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:22px 22px 16px;touch-action:pan-x}
.comm-header h2{margin:3px 0 0;font-size:24px;color:var(--comm-ink);font-weight:700}
.comm-header [data-close]{flex:0 0 44px;font-size:20px}
.comm-eyebrow{font-size:12px;letter-spacing:.05em;color:var(--comm-muted)}
.comm-tabs{display:flex;gap:6px;padding:0 22px 14px;border-bottom:1px solid var(--comm-line)}
.comm-tabs button{flex:1;border:0;font-weight:600}
.comm-drawer [aria-pressed=true]{background:var(--comm-soft);color:var(--comm-action)}
.comm-demo-note{background:var(--comm-soft);color:var(--comm-muted);border-left:3px solid var(--comm-green);font-size:13px;margin:14px 22px 8px;padding:10px 12px}
.comm-content{overflow:auto;overscroll-behavior:contain;flex:1;padding:12px 22px 22px}
.comm-filter-row{display:flex;gap:6px;flex-wrap:wrap}
.comm-filter-row button{font-size:13px;padding:8px 10px}
.comm-section-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0;color:var(--comm-muted);font-size:13px}
.comm-drawer .comm-link{border:0;background:transparent;color:var(--comm-action);font-size:14px;padding:7px 5px;min-height:44px;text-align:left}
.comm-drawer .comm-primary{background:var(--comm-action);border-color:var(--comm-action);color:white;font-weight:600;font-size:14px}
.comm-drawer .comm-primary:hover{background:var(--comm-action)}
.comm-drawer button:disabled{opacity:.5;cursor:not-allowed}
.comm-event{border:1px solid var(--comm-line);border-radius:12px;padding:15px;margin:10px 0;background:#fff}
.comm-event.is-unread{background:var(--comm-pale);border-color:var(--comm-line)}
.comm-event-top{display:flex;gap:10px;align-items:flex-start}
.comm-event-top strong{font-size:15px;display:block}
.comm-event small,.comm-thread small,.comm-context small{display:block;color:var(--comm-muted);font-size:13px;margin-top:4px}
.comm-event-icon,.comm-thread-symbol{display:grid;place-items:center;flex:0 0 36px;height:36px;background:var(--comm-soft);border-radius:10px;color:var(--comm-action)}
.comm-dot{display:block;flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:var(--comm-green);margin:8px 0 0 auto}
.comm-event p{font-size:14px;color:var(--comm-muted);margin:10px 0 2px}
.comm-event-actions{display:flex;gap:8px;flex-wrap:wrap}
.comm-drawer .comm-event-actions button{font-size:13px}
.comm-empty{padding:28px 10px;text-align:center;color:var(--comm-muted);font-size:15px}
.comm-error,.comm-save-status{font-size:13px;color:var(--comm-muted);min-height:18px;margin:8px 0 0}
.comm-error{color:#a92b3c}
.comm-drawer input,.comm-drawer select,.comm-drawer textarea{width:100%;border:1px solid var(--comm-line);border-radius:9px;background:#fff;color:var(--comm-ink);padding:11px;min-height:44px;font-size:16px}
.comm-new{background:var(--comm-soft);padding:12px;border-radius:10px;margin:12px 0;display:grid;gap:10px}
.comm-new label,.comm-compose label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
.comm-drawer .comm-thread{display:flex;width:100%;gap:12px;align-items:flex-start;text-align:left;margin-top:10px;padding:15px;border-color:var(--comm-line)}
.comm-thread strong{font-size:15px}
.comm-snippet{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--comm-muted);font-size:14px;margin-top:8px;overflow-wrap:anywhere}
.comm-conversation{display:flex;flex-direction:column;overflow:hidden;gap:8px}
.comm-back{align-self:flex-start;flex-shrink:0}
.comm-context{background:var(--comm-soft);border:1px solid var(--comm-line);border-radius:10px;padding:12px;flex-shrink:0}
.comm-context strong{font-size:16px}
.comm-rule{font-size:12px;color:var(--comm-muted);margin:0;flex-shrink:0}
.comm-messages{overflow:auto;overscroll-behavior:contain;flex:1;min-height:80px;padding:8px 2px}
.comm-bubble{max-width:92%;border-radius:12px 12px 12px 3px;background:var(--comm-pale);padding:12px 14px;margin:0 0 14px;overflow-wrap:anywhere}
.comm-bubble p{white-space:pre-wrap;font-size:15px;margin:7px 0}
.comm-bubble small{color:var(--comm-muted);font-size:12px}
.comm-bubble.is-own{background:var(--comm-bubble);margin-left:auto;border-radius:12px 12px 3px 12px}
.comm-compose{flex-shrink:0;border-top:1px solid var(--comm-line);padding-top:10px}
.comm-compose textarea{resize:vertical;max-height:120px;min-height:64px}
.comm-compose .comm-section-row{margin:5px 0 0}
.comm-handle{display:none}
@media(max-width:1100px){.comm-button-label{display:none}body.financial-desk .comm-launch{padding:9px}.comm-count{position:absolute;top:0;right:-3px}}
@media(max-width:760px){
 body.financial-desk .content-topbar-tools{flex-wrap:nowrap;gap:10px}
 .comm-tools{gap:5px;flex-shrink:0}
 body.financial-desk .comm-launch{width:44px;height:44px;justify-content:center}
 dialog.comm-drawer{inset:auto 0 0;width:100%;max-width:100%;height:94dvh;max-height:94dvh;border-radius:20px 20px 0 0;padding-bottom:env(safe-area-inset-bottom)}
 .comm-handle{display:block;flex-shrink:0;width:42px;height:5px;min-height:5px;border-radius:8px;background:var(--comm-line);margin:10px auto 0;touch-action:pan-x}
 .comm-header{padding:12px 16px 10px}.comm-header h2{font-size:22px}
 .comm-tabs{padding:0 16px 10px}.comm-tabs button{font-size:14px;padding:8px}
 .comm-demo-note{margin:10px 16px 4px;font-size:12px;padding:7px 10px}
 .comm-content{padding:10px 16px 16px}.comm-context{padding:8px 10px}
 .comm-context .comm-link{padding:4px 0;min-height:36px}.comm-context small{font-size:12px}
 .comm-rule{font-size:12px}.comm-conversation{gap:5px}
 .comm-compose textarea{height:64px}.comm-section-row{flex-wrap:wrap}
}
@media(max-height:650px){.comm-conversation{overflow:auto}.comm-messages{flex:none;min-height:90px;max-height:160px}.comm-header{padding-top:10px;padding-bottom:8px}.comm-demo-note{margin-top:5px}.comm-conversation .comm-rule{display:none}}
/* The application's older global form rules also match dialogs. Keep this preview readable. */
#comm-dialog h2{font-size:24px;line-height:1.25}
#comm-dialog :is(button,label,small,.comm-demo-note,.comm-rule,.comm-eyebrow,.comm-section-row,.comm-save-status,.comm-char){font-size:14px;line-height:1.4}
#comm-dialog :is(input,select,textarea){font-size:16px;line-height:1.4;border-radius:9px}
#comm-dialog button{border-radius:9px;min-height:44px}
#comm-dialog .comm-header [data-close]{font-size:20px}
#comm-dialog .comm-bubble p{font-size:16px;line-height:1.5}
#comm-dialog .comm-event-top strong,#comm-dialog .comm-thread strong{font-size:16px}
#comm-dialog .comm-compose label{margin-bottom:6px}
body.financial-desk .comm-launch{font-family:inherit;font-size:14px;font-weight:600;line-height:1.3}
/* Chat layout; both communication panels use the shared school-green palette. */
#comm-dialog .comm-window-actions{display:flex;align-items:center;gap:6px}
#comm-dialog[data-mode=discussions]{inset:16px;margin:auto;width:980px;max-width:calc(100vw - 32px);height:calc(100dvh - 32px);color:var(--comm-ink);background:#fff;--chat-accent:var(--comm-action);--chat-line:var(--comm-line)}
#comm-dialog[data-mode=discussions].is-expanded{inset:0;width:100vw;max-width:100vw;height:100dvh;border-radius:0}
#comm-dialog[data-mode=discussions] .comm-header{padding:10px 18px;border-bottom:1px solid var(--chat-line);flex-shrink:0}
#comm-dialog[data-mode=discussions] .comm-header h2{font-size:22px;color:var(--comm-ink);margin:0}
#comm-dialog[data-mode=discussions] .comm-eyebrow{display:none}
#comm-dialog[data-mode=discussions] .comm-tabs{padding:4px 18px;border-bottom:1px solid var(--chat-line);flex-shrink:0}
#comm-dialog[data-mode=discussions] .comm-tabs button{flex:0 1 auto;padding:8px 16px}
#comm-dialog[data-mode=discussions] .comm-demo-note{margin:0;padding:5px 18px;font-size:13px;border:0;background:var(--comm-pale);color:var(--comm-muted);flex-shrink:0}
#comm-dialog[data-mode=discussions] .comm-content{min-height:0;padding:14px 18px 18px}
#comm-dialog[data-mode=discussions] :is(button,.comm-link){color:var(--chat-accent)}
#comm-dialog[data-mode=discussions] button{border-color:var(--chat-line);background:#fff}
#comm-dialog[data-mode=discussions] button:hover{background:var(--comm-soft)}
#comm-dialog[data-mode=discussions] [aria-pressed=true]{background:var(--comm-soft);color:var(--comm-action)}
#comm-dialog[data-mode=discussions] .comm-primary{background:var(--comm-action);border-color:var(--comm-action);color:#fff}
#comm-dialog[data-mode=discussions] .comm-primary:hover{background:var(--comm-action)}
#comm-dialog[data-mode=discussions] :is(input,select,textarea){border-color:var(--comm-line);color:var(--comm-ink)}
#comm-dialog[data-mode=discussions] :is(button,input,select,textarea):focus-visible{outline-color:var(--comm-green)}
#comm-dialog[data-mode=discussions] :is(.comm-thread-symbol,.comm-new){background:var(--comm-soft);color:var(--comm-action)}
#comm-dialog[data-mode=discussions] .comm-dot{background:var(--comm-green)}
#comm-dialog[data-mode=discussions] :is(.comm-section-row,.comm-snippet,.comm-thread small){color:var(--comm-muted)}
#comm-dialog[data-mode=discussions] .comm-conversation{padding:0;min-height:0;gap:0;display:flex;overflow:hidden}
#comm-dialog[data-mode=discussions] .comm-context{display:flex;align-items:center;gap:12px;padding:8px 18px;background:#fff;border:0;border-bottom:1px solid var(--chat-line);border-radius:0;margin:0}
#comm-dialog .comm-document-title{flex:1}
#comm-dialog[data-mode=discussions] .comm-context small{color:var(--comm-muted);margin-top:2px;font-size:13px}
#comm-dialog[data-mode=discussions] .comm-context strong{font-size:16px}
#comm-dialog[data-mode=discussions] .comm-back{align-self:center;font-size:22px;min-width:44px;padding:6px;flex-shrink:0}
#comm-dialog .comm-history{position:relative;flex:1;min-height:0;display:flex;overflow:hidden;background:var(--comm-pale)}
#comm-dialog .comm-messages{flex:1;min-height:0;max-height:none;overflow-y:auto;padding:20px 24px;scrollbar-gutter:stable;overscroll-behavior:contain}
#comm-dialog .comm-message{display:flex;gap:10px;align-items:flex-start;margin:0 0 20px;overflow-wrap:anywhere}
#comm-dialog .comm-message-body{max-width:82%;min-width:0}
#comm-dialog .comm-message.is-own{flex-direction:row-reverse}
#comm-dialog .comm-message-byline{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:0 2px 5px;color:var(--comm-action);line-height:1.3}
#comm-dialog .comm-message-byline strong{font-size:14px;font-weight:600}
#comm-dialog .comm-message-byline time{font-size:12px;color:var(--comm-muted)}
#comm-dialog .comm-avatar{width:36px;height:36px;display:grid;place-items:center;flex:0 0 36px;overflow:hidden;border-radius:50%;background:var(--comm-bubble);color:var(--comm-ink);font-size:13px;font-weight:700;border:1px solid var(--comm-line)}
#comm-dialog .comm-avatar img{height:100%;width:100%;object-fit:cover;display:block}
#comm-dialog .comm-bubble{margin:0;max-width:none;border:1px solid var(--comm-line);background:#fff;border-radius:0 14px 14px 14px;padding:10px 14px;color:var(--comm-ink)}
#comm-dialog .comm-bubble.is-own{background:var(--comm-bubble);border-color:var(--comm-line);border-radius:14px 0 14px 14px}
#comm-dialog .comm-bubble p{margin:0;font-size:16px;line-height:1.5}
#comm-dialog .comm-compose{padding:10px 18px 8px;flex-shrink:0;margin:0;border-top:1px solid var(--chat-line);background:#fff}
#comm-dialog .comm-input-row{display:flex;gap:10px;align-items:center}
#comm-dialog .comm-profile{padding:0;border:0;background:transparent;flex:0 0 44px;height:44px;display:grid;place-items:center}
#comm-dialog .comm-compose textarea{min-height:52px;height:52px;max-height:100px;resize:vertical;padding:10px 12px;flex:1}
#comm-dialog .comm-compose-tools{display:flex;gap:8px;align-items:center;margin-top:6px}
#comm-dialog .comm-attach{display:inline-flex;align-items:center;gap:7px;margin-left:auto;background:transparent;border:0;padding:6px 8px}
#comm-dialog .comm-char{margin-left:0;font-size:12px;color:var(--comm-muted)}
#comm-dialog .comm-save-status{min-height:0;margin:0;font-size:12px;color:var(--comm-muted)}
#comm-dialog .comm-save-status:not(:empty){margin-top:4px}
#comm-dialog .comm-latest{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#fff;box-shadow:0 3px 14px #203b2230;white-space:nowrap;z-index:1}
#comm-dialog [hidden]{display:none!important}
#comm-dialog .comm-pending{max-height:90px;overflow-y:auto;display:flex;flex-wrap:wrap;gap:6px}
#comm-dialog .comm-pending:not(:empty){padding-bottom:8px}
#comm-dialog .comm-pending-file{display:flex;gap:8px;align-items:center;border:1px solid var(--chat-line);background:var(--comm-pale);border-radius:8px;padding:2px 6px 2px 10px;max-width:100%;font-size:13px;overflow-wrap:anywhere}
#comm-dialog .comm-pending-file small{font-size:12px;margin-left:6px;white-space:nowrap}
#comm-dialog .comm-pending-file button{border:0;background:transparent;padding:4px;min-width:44px;flex-shrink:0}
#comm-dialog .comm-file-list{display:grid;gap:8px;margin-top:8px;min-width:min(240px,100%)}
#comm-dialog .comm-file{display:grid;grid-template-columns:auto minmax(0,1fr) 44px;gap:8px;align-items:center;background:#ffffffb8;border:1px solid var(--comm-line);padding:8px;border-radius:9px}
#comm-dialog .comm-file-kind{font-size:11px;font-weight:700;color:var(--comm-action);background:var(--comm-soft);padding:8px 5px;border-radius:5px}
#comm-dialog .comm-file-name{font-size:14px;line-height:1.3;overflow-wrap:anywhere}
#comm-dialog .comm-file-name small{display:block;color:var(--comm-muted);font-size:12px;margin-top:4px}
#comm-dialog .comm-file-error{grid-column:1/-1;font-size:13px;color:#963845}
#comm-dialog .comm-file-error:empty{display:none}
#comm-dialog .comm-photo-preview{grid-column:1/-1;padding:0;border:0;overflow:hidden;height:150px;max-width:300px;display:block;background:var(--comm-pale)}
#comm-dialog .comm-photo-preview img{width:100%;height:150px;object-fit:cover;display:block}
.comm-photo-dialog{position:fixed;inset:16px;margin:auto;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:14px;border:1px solid var(--comm-line);border-radius:12px;background:#fff;color:var(--comm-ink)}
.comm-photo-dialog::backdrop{background:#122018aa}
.comm-photo-dialog header{display:flex;align-items:center;gap:20px;justify-content:space-between;margin-bottom:12px;overflow-wrap:anywhere}
.comm-photo-dialog button{min-width:44px;min-height:44px;font-size:20px;border:1px solid var(--comm-line);background:var(--comm-pale);color:var(--comm-action);border-radius:8px;cursor:pointer}
.comm-photo-dialog img{display:block;max-width:100%;max-height:calc(100dvh - 130px);object-fit:contain;margin:auto}
@media(max-width:760px){
 #comm-dialog[data-mode=discussions]{inset:0;margin:0;width:100%;max-width:100%;height:100dvh;max-height:100dvh;border-radius:0}
 #comm-dialog[data-mode=discussions] .comm-handle{margin:6px auto 0;background:var(--comm-line)}
 #comm-dialog[data-mode=discussions] .comm-header{padding:4px 12px}
 #comm-dialog[data-mode=discussions] .comm-header h2{font-size:20px}
 #comm-dialog[data-mode=discussions] [data-expand]{display:none}
 #comm-dialog[data-mode=discussions] .comm-tabs{padding:2px 12px}
 #comm-dialog[data-mode=discussions] .comm-tabs button{flex:1;font-size:14px}
 #comm-dialog[data-mode=discussions] .comm-demo-note{padding:4px 12px;font-size:12px;line-height:1.35}
 #comm-dialog[data-mode=discussions] .comm-context{padding:6px 10px;gap:6px}
 #comm-dialog[data-mode=discussions] .comm-context strong{font-size:14px}
 #comm-dialog[data-mode=discussions] .comm-context small{font-size:12px}
 #comm-dialog[data-mode=discussions] .comm-context [data-document]{font-size:12px;max-width:76px;padding:4px}
 #comm-dialog .comm-messages{padding:14px 10px;scrollbar-gutter:auto}
 #comm-dialog .comm-message{gap:7px;margin-bottom:16px}
 #comm-dialog .comm-avatar{width:30px;height:30px;flex-basis:30px;font-size:11px}
 #comm-dialog .comm-message-body{max-width:calc(100% - 38px)}
 #comm-dialog .comm-message-byline{gap:4px 8px}
 #comm-dialog .comm-message-byline strong{font-size:13px}
 #comm-dialog .comm-bubble{padding:9px 11px}
 #comm-dialog .comm-compose{padding:8px 10px max(8px,env(safe-area-inset-bottom))}
 #comm-dialog .comm-compose textarea{height:48px;min-height:48px}
 #comm-dialog .comm-compose-tools{gap:4px}
 #comm-dialog .comm-attach{font-size:13px;padding:6px 4px}
 #comm-dialog .comm-char{display:none}
 #comm-dialog .comm-compose [type=submit]{margin-left:0}
 #comm-dialog .comm-photo-preview{max-width:100%;height:120px}
 #comm-dialog .comm-photo-preview img{height:120px}
}
@media(max-height:500px){
 #comm-dialog[data-mode=discussions].has-conversation .comm-tabs,#comm-dialog[data-mode=discussions].has-conversation .comm-demo-note{display:none}
 #comm-dialog[data-mode=discussions].has-conversation .comm-header{padding-top:2px;padding-bottom:2px}
 #comm-dialog .comm-compose textarea{height:44px;min-height:44px}
 #comm-dialog .comm-pending{max-height:50px}
}

/* Use the exact stripe green on primary surfaces; dark labels keep text legible. */
#comm-dialog[data-mode] .comm-primary{background:var(--comm-green);border-color:var(--comm-green);color:#102d18}
#comm-dialog[data-mode] .comm-primary:hover{background:color-mix(in srgb,var(--comm-green) 88%,white);border-color:var(--comm-green);color:#102d18}
#comm-dialog[data-mode] [aria-pressed=true]{background:var(--comm-soft);color:var(--comm-action);box-shadow:inset 0 -3px var(--comm-green)}
#comm-dialog[data-mode] :is(.comm-event-icon,.comm-thread-symbol){background:var(--comm-soft);color:var(--comm-action)}
#comm-dialog[data-mode] .comm-dot{background:var(--comm-green)}

/* One aligned toolbar, retaining the original select and its language-switch handler. */
body.financial-desk .content-topbar-tools.comm-topbar-tools{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px;width:auto;max-width:100%;margin:0}
body.financial-desk .comm-topbar-tools .comm-tools{flex:none}
body.financial-desk .comm-topbar-tools .language-picker{display:block;flex:0 0 72px;width:72px;min-width:0;margin:0;padding:0}
body.financial-desk .comm-topbar-tools .language-picker>span{display:none}
body.financial-desk .comm-topbar-tools #language-select{box-sizing:border-box;width:72px;min-width:72px;max-width:72px;height:44px;min-height:44px;margin:0;padding:9px 8px 9px 12px;border:1px solid var(--comm-line);border-radius:10px;background-color:#fff;color:var(--comm-ink);font-size:14px;font-weight:600;line-height:1.3;cursor:pointer}
body.financial-desk .comm-topbar-tools .comm-launch{height:44px;min-height:44px}
body.financial-desk .comm-topbar-tools #language-select:focus-visible{outline:3px solid var(--comm-green);outline-offset:2px}
