/* WI-VET-024 Communications Centre — compact, adaptive. Layout follows the width of the area it sits in (container query), so it
   behaves the same beside the Manager sidebar and inside the Employee shell: split inbox/conversation when there is room,
   drill-down single column when there is not. Palette and type follow the accepted VetRota identity. */
.cm-host{min-width:0}
.cm-wrap,.cm-bell-wrap{--cm-brand:#148653;--cm-deep:#112d29;--cm-line:#e0e7e5;--cm-ink:#193047;--cm-muted:#5b6b66;--cm-soft:#f1f7f3;--cm-warn:#9a5b00;--cm-err:#b3261e}
.cm-wrap{container-type:inline-size;min-width:0;--cm-brand:#148653;--cm-deep:#112d29;--cm-line:#e0e7e5;--cm-ink:#193047;--cm-muted:#5b6b66;--cm-soft:#f1f7f3;--cm-warn:#9a5b00;--cm-err:#b3261e}
.cm-context{font-size:12px;color:var(--cm-muted);margin:0 0 8px}.cm-context b{color:var(--cm-ink)}
.cm{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:0;border:1px solid var(--cm-line);border-radius:14px;background:#fff;overflow:hidden;height:clamp(420px,calc(100vh - 250px),760px);color:var(--cm-ink)}
.cm *{box-sizing:border-box}
.cm-pane{min-width:0;min-height:0;display:flex;flex-direction:column}
.cm-list-pane{border-right:1px solid var(--cm-line);background:#fbfcfb}
.cm-detail-pane{background:#fff;outline:none}
.cm-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.cm button,.cm input,.cm select,.cm textarea{font:inherit;color:inherit}
.cm :focus-visible,.cm-bell-wrap :focus-visible{outline:2px solid #008f49;outline-offset:2px}

/* toolbar */
.cm-tools{padding:10px 10px 8px;border-bottom:1px solid var(--cm-line);display:grid;gap:8px}
.cm-search{display:flex;align-items:center;gap:6px;border:1px solid var(--cm-line);border-radius:10px;background:#fff;padding:0 8px;min-height:36px}
.cm-search input{border:0;outline:0;background:transparent;flex:1;min-width:0;min-height:34px;font-size:13px}
.cm-search:focus-within{border-color:#008f49;box-shadow:0 0 0 2px #008f4933}
.cm-actions{display:flex;gap:6px;flex-wrap:wrap}
.cm-tabs{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.cm-tabs button{border:1px solid var(--cm-line);background:#fff;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:600;color:var(--cm-muted);cursor:pointer;min-height:28px}
.cm-tabs button[aria-pressed=true]{background:var(--cm-deep);border-color:var(--cm-deep);color:#fff}
.cm-unread{display:inline-flex;align-items:center;gap:4px;font-size:12px;margin-left:auto;color:var(--cm-muted);cursor:pointer}
.cm-ic{width:16px;height:16px;flex:0 0 auto}
.cm-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:5px 12px;border:1px solid #cbd9d3;border-radius:10px;background:#fff;font-size:13px;font-weight:650;cursor:pointer}
.cm-btn:hover{background:#f1f8f3;border-color:#b5d8be}
.cm-btn.primary{background:var(--cm-brand);border-color:var(--cm-brand);color:#fff}.cm-btn.primary:hover{background:#0f7345}
.cm-btn[disabled]{opacity:.6;cursor:default}

/* inbox list */
.cm-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.cm-items{list-style:none;margin:0;padding:0}
.cm-item{display:flex;gap:10px;width:100%;text-align:left;border:0;border-bottom:1px solid #edf2ef;background:transparent;padding:9px 12px;cursor:pointer;align-items:flex-start;min-height:56px}
.cm-item:hover{background:#f1f7f3}.cm-item[aria-current=true]{background:#e6f3ea;box-shadow:inset 3px 0 0 var(--cm-brand)}
.cm-av{flex:0 0 34px;width:34px;height:34px;border-radius:50%;background:#dcebe3;color:var(--cm-deep);display:grid;place-items:center;font-size:12px;font-weight:800}
.cm-av.kind-announcement{background:#fff1d6;color:#8a5200}.cm-av.kind-notification{background:#e4ecf8;color:#25476f}
.cm-item-main{flex:1;min-width:0;display:grid;gap:2px}
.cm-item-top{display:flex;gap:8px;align-items:center;justify-content:space-between;min-width:0}
.cm-item-t{font-size:13.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.cm-item.is-unread .cm-item-t{font-weight:850}
.cm-item-d{font-size:11px;color:var(--cm-muted);flex:0 0 auto}
.cm-item-x{font-size:12.5px;color:var(--cm-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.cm-tag{display:inline-block;font-size:10.5px;font-weight:800;letter-spacing:.03em;text-transform:uppercase;color:#25476f;background:#e8eff9;border-radius:6px;padding:1px 6px;margin-right:6px}
.cm-n{flex:0 0 auto;min-width:20px;height:20px;border-radius:10px;background:var(--cm-brand);color:#fff;font-size:11px;font-weight:800;display:grid;place-items:center;padding:0 6px}
.cm-dot{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:var(--cm-brand)}

/* states */
.cm-state{margin:16px;padding:16px;border:1px dashed #c9d8d1;border-radius:12px;background:#fff;text-align:center}
.cm-state b{display:block;margin-bottom:4px}.cm-state p{margin:0 0 10px;color:var(--cm-muted);font-size:13px}.cm-article p,.cm-note{color:var(--cm-ink)}.cm-article .cm-hint,.cm-note{color:var(--cm-muted)}
.cm-state.error{border-color:#e7b4b0;background:#fff7f6}.cm-state.cm-pick{border:0;background:transparent;margin:auto}
.cm-loading{display:flex;align-items:center;gap:8px;padding:16px;color:var(--cm-muted);font-size:13px}
.cm-spin{width:16px;height:16px;border:2px solid #cfe0d7;border-top-color:var(--cm-brand);border-radius:50%;animation:cmspin .8s linear infinite}
@keyframes cmspin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.cm-spin{animation:none}}

/* detail */
.cm-dhead{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--cm-line);flex:0 0 auto;min-width:0}
.cm-dhead>div{min-width:0}
.cm-who{display:flex;gap:10px;align-items:center;min-width:0}
.cm-h{font-size:16px;margin:0;line-height:1.25;overflow-wrap:anywhere;outline:none}.cm-dhead small{color:var(--cm-muted);font-size:12px}
.cm-back{display:none;padding:4px 10px;min-height:34px}
.cm-msgs{flex:1;min-height:0;overflow:auto;padding:12px 14px;background:#f8faf9;overscroll-behavior:contain}
.cm-msg-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.cm-msg{display:flex;flex-direction:column;max-width:min(78%,560px)}.cm-msg.mine{align-self:flex-end;margin-left:auto;align-items:flex-end}.cm-msg.theirs{align-items:flex-start}
.cm-bubble{border-radius:14px;padding:7px 12px;border:1px solid var(--cm-line);background:#fff}
.cm-msg.mine .cm-bubble{background:#dff1e6;border-color:#bfe0cb}
.cm-text{color:var(--cm-ink);margin:0;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font-size:14px;line-height:1.45}
.cm-msg-meta{font-size:11px;color:var(--cm-muted);margin-top:2px}
.cm-older{margin:0 auto 10px;display:flex}
.cm-composer,.cm-form{padding:10px 14px;border-top:1px solid var(--cm-line);display:grid;gap:6px;flex:0 0 auto;background:#fff}
.cm-form{border-top:0;overflow:auto;align-content:start;max-width:640px}
.cm-form label{font-size:12px;font-weight:700;color:var(--cm-muted)}
.cm textarea,.cm-form input:not([type=checkbox]),.cm-form select{width:100%;border:1px solid #cbd9d3;border-radius:10px;padding:8px 10px;background:#fff;font-size:14px;min-height:38px}
.cm textarea{resize:vertical;min-height:44px;max-height:180px;line-height:1.4}
.cm-check{display:flex!important;gap:8px;align-items:center;font-weight:500!important;color:var(--cm-ink)!important}
.cm-send-row{display:flex;gap:10px;align-items:center;justify-content:space-between}.cm-count{color:var(--cm-muted);font-size:11.5px}.cm-count.low{color:var(--cm-warn);font-weight:700}
.cm-err{margin:0;color:var(--cm-err);font-size:12.5px;font-weight:600}
.cm-note{margin:0;padding:12px 14px;border-top:1px solid var(--cm-line);font-size:13px;color:var(--cm-muted);background:#fbfcfb}
.cm-article{padding:14px 16px;overflow:auto;display:grid;gap:10px;align-content:start;max-width:720px}
.cm-hint{margin:0;font-size:12.5px;color:var(--cm-muted)}.cm-ok{margin:0;color:#0f6f40;font-weight:700;font-size:13px}
.cm-stats{display:flex;gap:18px;margin:6px 0 0;padding:10px 0 0;border-top:1px solid var(--cm-line)}.cm-stats div{display:grid;gap:0}.cm-stats dt{font-size:11px;color:var(--cm-muted);text-transform:uppercase;letter-spacing:.04em}.cm-stats dd{margin:0;font-size:18px;font-weight:800}

/* drill-down when the area is narrow (phones, small tablets) */
@container (max-width:640px){
  .cm{grid-template-columns:minmax(0,1fr);height:clamp(420px,calc(100dvh - 230px),820px);border-radius:12px}
  .cm-list-pane{border-right:0}.cm .cm-detail-pane{display:none}
  .cm.cm-has-sel .cm-list-pane{display:none}.cm.cm-has-sel .cm-detail-pane{display:flex}
  /* an open conversation uses the whole screen below the page chrome, so the composer is on screen without scrolling */
  .cm.cm-has-sel{height:calc(100dvh - 20px);scroll-margin-top:8px}
  .emp-main .cm.cm-has-sel{height:calc(100dvh - 160px);scroll-margin-top:72px}
  .cm-back{display:inline-flex}.cm-msg{max-width:90%}
  .cm-btn,.cm-tabs button{min-height:40px}.cm-item{min-height:60px}.cm-unread{min-height:40px}
  .cm textarea,.cm-form input:not([type=checkbox]),.cm-form select{font-size:16px}       /* no iOS zoom on focus */
}
@container (min-width:641px) and (max-width:900px){.cm{grid-template-columns:minmax(220px,270px) minmax(0,1fr)}.cm-tabs button{padding:3px 8px}}

/* header bell (both shells) */
.cm-bell-wrap{position:relative;display:inline-flex}
.cm-bell{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;border:1px solid #dbe6df;background:linear-gradient(180deg,#fff,#f7faf8);color:#17342e;cursor:pointer;padding:0}
.cm-bell:hover{background:#f1f8f3;border-color:#b5d8be}
.cm-bell-count{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#c0392b;color:#fff;font-size:10.5px;font-weight:800;display:grid;place-items:center;box-shadow:0 0 0 2px #fff;line-height:1}
.cm-bell-pop{position:absolute;right:0;top:calc(100% + 8px);z-index:60;width:min(340px,calc(100vw - 24px));background:#fff;color:#193047;border:1px solid #dbe6df;border-radius:14px;box-shadow:0 12px 32px #0f2a2440;padding:10px;display:grid;gap:8px;text-align:left}
.cm-bell-pop[hidden]{display:none}
.cm-bell-h{display:flex;justify-content:space-between;align-items:baseline;font-size:13px}.cm-bell-h span{font-size:12px;color:#5b6b66}
.cm-pv-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.cm-pv{display:grid;grid-template-columns:1fr auto;gap:0 8px;width:100%;text-align:left;border:0;background:transparent;border-radius:10px;padding:7px 8px;cursor:pointer;font:inherit;color:inherit}
.cm-pv:hover{background:#f1f7f3}.cm-pv-t{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-pv-s{grid-column:1;font-size:12px;color:#5b6b66;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-pv-d{grid-row:1;grid-column:2;font-size:11px;color:#5b6b66}
.cm-pv-empty{margin:0;font-size:13px;color:#5b6b66;padding:4px 6px}
.cm-pv-open{width:100%}
.cm-bell-wrap .cm-btn{min-height:34px}
@media(max-width:640px),(pointer:coarse){.cm-bell{width:44px;height:44px}.cm-pv{min-height:44px}}
.emp-top .cm-bell-wrap{flex:0 0 auto}
.emp-top .cm-bell{width:44px;height:44px;border-color:#ffffff40;background:transparent;color:#fff}
.emp-top .cm-bell:hover{background:#ffffff1f}
@media(min-width:960px){.emp-top .cm-bell{color:#5b6b66;border-color:#9aa79f}}
.emp-top .cm-bell-pop{position:fixed;right:12px;top:64px}
@media(min-width:960px){.emp-top .cm-bell-pop{position:absolute;right:0;top:calc(100% + 8px)}}
.emp-main .cm-wrap{margin:0}

/* page chrome allowances: the whole Inbox (list + composer) should fit under the page header without scrolling the page */
.emp-main .cm{height:clamp(420px,calc(100vh - 340px),760px)}
@media(max-width:1000px){.main header{flex-wrap:wrap}.main header .header-right{flex-wrap:wrap;max-width:100%}}
.cm-article .cm-btn{justify-self:start}
