/* The portal header and navigation keep their normal positions while the inbox is open. */
body[data-chat-open] {
  height:100vh;
  height:100dvh;
  min-height:0;
  overflow:hidden;
}
body[data-chat-open] > .portal-header {flex:none}
body[data-chat-open] .employee-shell {
  flex:1 1 0;
  display:flex;
  min-height:0;
  max-width:none;
  padding:clamp(12px,1.5vw,24px) var(--gutter);
}
body[data-chat-open] .employee-shell > :not(#chat-dock),
body[data-chat-open] > .portal-foot {display:none !important}

body[data-chat-open] #chat-dock {
  flex:1;
  position:static;
  width:100%;
  max-width:none;
  min-width:0;
  min-height:0;
  z-index:auto;
}
body[data-chat-open] #chat-panel {
  width:100%;
  height:100%;
  max-width:none;
  min-height:0;
  display:grid;
  grid-template: auto minmax(0,1fr) / minmax(0,1fr);
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 2px 8px #1526300a;
  animation:none;
}
body[data-chat-open] #chat-panel[data-split] {grid-template-columns:clamp(218px,27%,340px) minmax(0,1fr)}
#chat-sidebar {
  grid-row:1 / 3;
  display:flex;
  flex-direction:column;
  min-height:0;
  min-width:0;
  background:white;
  border-inline-end:1px solid var(--line);
}
#chat-sidebar h2 {margin:0;padding:16px 16px 4px;font:400 1.5rem/1.25 var(--display)}
#chat-contact-list {
  flex:1;
  min-height:0;
  min-width:0;
  display:flex;
  flex-direction:column;
  padding:12px;
}
#chat-contact-list input {
  flex:none;
  margin:0;
  width:100%;
  border-color:var(--line);
  background:var(--paper);
  font:inherit;
}
#chat-contact-list ul {
  min-height:0;
  margin:10px 0 0;
  padding:0;
  list-style:none;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
#chat-panel .chat-picker {padding:0}
#chat-panel .chat-head {grid-row:1;min-width:0}
#chat-panel :is(.chat-picker,.chat-thread) {grid-row:2;min-width:0;min-height:0}
#chat-panel[data-split] :is(.chat-head,.chat-thread) {grid-column:2}
#chat-panel #chat-resize[aria-pressed="true"] .expand-icon {display:none}
#chat-panel #chat-resize[aria-pressed="true"] .restore-icon {display:block}
#chat-panel .chat-compose {flex:none;background:white}
#chat-panel .chat-history {min-height:0}
#chat-panel .thread-heading p {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#chat-panel .chat-emoji-toggle {color:var(--gold);background:var(--paper);border-color:var(--line)}

body[data-portal-design="employee"] .rtc-invites {top:calc(var(--bar) + 8px)}
body[data-portal-design="employee"] .rtc-stage {max-height:calc(100dvh - var(--bar) - 32px)}
@media (max-width:600px) {
  body[data-chat-open] .employee-shell {padding:0}
  body[data-chat-open] #chat-panel {border:0;border-radius:0}
  #chat-panel .chat-head {padding:8px;gap:2px}
  #chat-panel .chat-compose {padding-bottom:max(9px,env(safe-area-inset-bottom))}
  #chat-panel .chat-picker {padding-bottom:env(safe-area-inset-bottom)}
}