
/* Window sizes (quarter, third, half of a screen): what gives way first.
   861-1180 px (half of a 1920 screen, about a third of a wide one): the header keeps the full channel name and the topic gives way first.
   under 440 px (a quarter of a 1366 screen, small phones): header buttons get slightly smaller so the channel name stays readable. */
@media (min-width: 861px) and (max-width: 1180px) {
  #chat-title-heading { flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #chat-topic-display { flex: 0 1 auto; min-width: 0; max-width: 22vw; }
  #chat-search-input { min-width: 0; width: 140px; text-overflow: ellipsis; }
  #chat-search-input:focus { width: 190px; }
  body.members-open #chat-search-input { width: 100px; }
  body.members-open #chat-search-input:focus { width: 150px; }
}
@media (min-width: 861px) and (max-width: 1000px) {
  #chat-topic-display { display: none; }
}
/* the red "connection lost" icon sat in the middle of the top edge, on top of the channel name in a narrow window: in the desktop app it
   now lives in the empty middle of the title bar, and in a browser it is smaller and tucked into the header's top padding */
html.desk-tb:not(.ph) #offline-banner { top: 4px; width: 24px; height: 24px; z-index: 100002; box-shadow: none; }
html.desk-tb:not(.ph) #offline-banner svg { width: 14px; height: 14px; }
@media (max-width: 1100px) {
  html:not(.desk-tb):not(.ph) #offline-banner { top: 2px; width: 18px; height: 18px; }
  html:not(.desk-tb):not(.ph) #offline-banner svg { width: 11px; height: 11px; }
}
/* call screen in a half or quarter window: invite, pop out and full screen join the chat button in one row along the top edge,
   so the bottom holds only the call controls (they floated beside the Soundboard button and could cover it), and the tiles start below that row */
@container vcs (max-width: 720px) {
  #voice-call-screen .vc-chat, #voice-call-screen .vc-inv, #voice-call-screen .vc-corner-r { top: 12px !important; bottom: auto !important; }
  :root #voice-call-screen .vc-corner-r { right: 66px; left: auto; }
  :root #voice-call-screen .vc-inv { right: 182px; left: auto; }
  :root[dir="rtl"] #voice-call-screen .vc-corner-r { left: 66px; right: auto; }
  :root[dir="rtl"] #voice-call-screen .vc-inv { left: 182px; right: auto; }
  #voice-call-screen #voice-stage-grid { padding-top: 64px; }
  #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) { padding-top: 64px; }
}
@media (max-width: 440px) {
  html.ph .main-header { gap: 2px; padding-inline: 2px 4px; }
  html.ph .main-header > .icon-btn:not(#btn-hamburger) { width: 32px; height: 36px; }
  html.ph #btn-hamburger { width: 36px; }
  html.ph #chat-title-heading { flex: 1 1 auto; max-width: none; }
}
