
/* ============================ POP-UPS, NOTICES AND LINE ICONS ============================
   One look for every floating notice, and each theme gets its own version of it. Nothing here pushes the page around: the reconnect card and the
   email notice float over the app instead of sitting in the layout, so showing and hiding them no longer moves the chat or the side panels.
   Icons are Lucide line icons (ISC licence, lucide.dev): no emoji stand in for icons any more. */
:where(svg.ic) { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.gi { display: inline-flex; align-items: center; justify-content: center; }
.gi .ic { width: 16px; height: 16px; }
.settings-close .gi .ic { width: 18px; height: 18px; }

@keyframes pu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes pu-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
html:not(.ph) body.has-mail-bar .app { height: 100vh; height: 100dvh; }
html.desk-tb:not(.ph) body.has-mail-bar .app { height: calc(100dvh - 32px - var(--desk-bot)); }
html:not(.ph) #mail-bar.show, #reconnect-bar {
  position: fixed; z-index: 9990; left: 0; right: 0; margin: 0 auto; width: min(680px, calc(100vw - 24px)); height: auto; min-height: 0; top: calc(env(safe-area-inset-top, 0px) + 14px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px 12px; padding: 10px 44px 10px 30px; white-space: normal; text-align: start; line-height: 1.4;
  font-size: 13px; font-weight: 500; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-focus); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.4);
  animation: pu-in .24s cubic-bezier(.2,.8,.2,1) both;
}
html:not(.ph) #mail-bar.show::before, #reconnect-bar::before { content: ''; position: absolute; inset-inline-start: 13px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow, #f0b232); }
#reconnect-bar::before { background: var(--green, #23a55a); }
html:not(.ph) #mail-bar.show.red::before { background: var(--red, #da373c); }
html:not(.ph) #mail-bar.show.red { border-color: color-mix(in srgb, var(--red, #da373c) 60%, var(--border-focus)); }
html:not(.ph) #mail-bar.show #mail-bar-text { overflow: visible; text-overflow: clip; white-space: normal; flex: 1 1 auto; min-width: 0; }
html:not(.ph) #mail-bar.show button.mb-act, #reconnect-bar .btn { margin: 0; background: transparent; border: 1px solid var(--border-focus); color: var(--text); border-radius: 8px; padding: 3px 12px; font-size: 12.5px; }
html:not(.ph) #mail-bar.show button.mb-act:hover, #reconnect-bar .btn:hover { background: var(--bg-3); }
html:not(.ph) #mail-bar.show .mb-x, #reconnect-bar .rc-x { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
html:not(.ph) #mail-bar.show .mb-x { right: 10px; left: auto; }
html[dir="rtl"]:not(.ph) #mail-bar.show .mb-x { left: 10px; right: auto; }
#reconnect-bar > span:first-child { flex: 1 1 0; min-width: 0; }
html:not(.ph) #mail-bar.show #mail-bar-text { flex: 1 1 0; }
html:not(.ph) #mail-bar.show button.mb-act, #reconnect-bar .btn { flex: none; }
body.has-mail-bar #reconnect-bar { top: calc(env(safe-area-inset-top, 0px) + 68px); }
html.desk-tb:not(.ph) #mail-bar.show, html.desk-tb #reconnect-bar { top: 46px; }
html.desk-tb body.has-mail-bar #reconnect-bar { top: 100px; }
html.ph #reconnect-bar { position: fixed; left: 12px; right: 12px; width: auto; top: calc(var(--ph-top, 52px) + 8px); margin: 0; }
/* the tip card is the same family */
#ux-tip { border-radius: 14px; animation: pu-up .26s cubic-bezier(.2,.8,.2,1) both; }

/* System24: square, thin, no soft glow */
[data-theme="system24"] :is(#mail-bar.show, #reconnect-bar, #ux-tip) { border-radius: 2px; box-shadow: 0 0 0 1px var(--bg-0), 0 10px 26px rgba(0,0,0,.5); }
[data-theme="system24"] :is(#mail-bar.show, #reconnect-bar) .btn, [data-theme="system24"] #mail-bar.show button.mb-act { border-radius: 2px; }
/* classic: rounded and soft */
html.ui-classic :is(#mail-bar.show, #reconnect-bar, #ux-tip) { border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.34); }
html.ui-classic[data-theme="light"] :is(#mail-bar.show, #reconnect-bar, #ux-tip) { box-shadow: 0 10px 28px rgba(30,40,70,.18); }

@media (prefers-reduced-motion: reduce) { #mail-bar.show, #reconnect-bar, #ux-tip, .vc-popover { animation: none !important; } }
body.nomotion :is(#mail-bar.show, #reconnect-bar, #ux-tip, .vc-popover) { animation: none !important; }

/* the call menu opens from the button, never from the corner, and each theme shapes it */
@keyframes pu-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vc-popover { transform-origin: 50% 100%; animation: pu-pop .16s ease-out both; }
.vc-item .vc-ic { display: inline-flex; width: 22px; justify-content: center; flex: none; color: var(--muted); }
.vc-item .vc-ic .ic, .vc-item > .ic { width: 20px; height: 20px; }
.vc-item:hover .vc-ic { color: inherit; }
.vc-item .vc-on { margin-inline-start: auto; color: var(--green, #23a55a); display: inline-flex; }
.vc-item .vc-on .ic { width: 16px; height: 16px; }
[data-theme="system24"] .vc-popover { border-radius: 3px; }
html.ui-classic .vc-popover { border-radius: 12px; }

/* the voice panel buttons stay in one row in every theme, whatever the panel width */
.voice-connected-dock .voice-dock-tiles { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.voice-connected-dock .voice-dock-tiles .voice-dock-tile { width: 100%; max-width: none; min-width: 0; margin: 0; height: 34px; aspect-ratio: auto; }
.voice-connected-dock .voice-dock-tiles .voice-dock-tile .vi { width: 18px; height: 18px; }
html.ph .channels-pane .voice-connected-dock .voice-dock-tiles .voice-dock-tile { height: 40px; }

/* line icons where emoji used to be */
.vs-e .ic { width: 28px; height: 28px; color: var(--accent); }
.sb-btn > span .ic { width: 22px; height: 22px; }
.gx-snd button > span .ic { width: 18px; height: 18px; }
.tpl-ico .ic { width: 30px; height: 30px; color: var(--accent); }
.bot-pav .ic, .bp-big .ic { width: 1em; height: 1em; color: #fff; }
.um-item .ic { width: 16px; height: 16px; flex: none; }
.msg-reply .ic { width: 13px; height: 13px; vertical-align: -2px; }
.chat-file-download .ic, .gx-file-row .ic { width: 15px; height: 15px; vertical-align: -3px; }
.tile-badge .ic, .ov-m .ic, .stg-role .ic, .stg-hands .ic { width: 12px; height: 12px; vertical-align: -2px; }
.stream-action-badge .ic { width: 13px; height: 13px; vertical-align: -2px; }
.fullscreen-btn-badge .ic, .dmc-tf .ic, .wt-bar .ic { width: 16px; height: 16px; }
.gx-wave .ic { width: 16px; height: 16px; }
.gx-st-ok .big .ic { width: 40px; height: 40px; color: var(--green, #23a55a); }
.cn-ok .ic { width: 12px; height: 12px; }
#gx-slow .ic, .gx-th-lock .ic, .bst-gem .ic { width: 1.1em; height: 1.1em; }
.bst-gem .ic { width: 30px; height: 30px; color: var(--accent); }
#auth-done-ic .ic { width: 44px; height: 44px; color: var(--accent); }
.gx-vc-items { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

/* ---- streams are tiles: the same size as a person, in the same wall ---- */
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) :is(#stage-screen-slot, #multi-streams, #stream-tiles) { display: contents !important; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) :is(#stage-screen-card, .ms-card, .st-tile) { order: -1; flex: 0 0 auto !important; width: var(--tw) !important; height: var(--th) !important; min-height: 0 !important; max-width: none !important; max-height: none !important; aspect-ratio: auto !important; margin: 0 !important; box-sizing: border-box; border-radius: 12px; position: relative; overflow: hidden; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) :is(#stage-screen-card, .ms-card) .screen-video, #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) .ms-card video { width: 100%; height: 100%; max-height: none; object-fit: contain; background: #000; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-screen-card .stream-viewer-bar { opacity: 0; transition: opacity .15s; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-screen-card:hover .stream-viewer-bar { opacity: 1; }
.st-tile { cursor: pointer; display: flex; align-items: center; justify-content: center; background-color: color-mix(in srgb, var(--bg-3) 85%, var(--bg-0)); border: 1px solid color-mix(in srgb, var(--border-focus) 70%, transparent); color: var(--bright); }
.st-tile .st-av { opacity: .3; }
.st-tile .st-live { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--red, #ed4245); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; }
.st-tile .st-view { position: absolute; top: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.st-tile .st-view .ic { width: 13px; height: 13px; }
.st-tile .st-name { position: absolute; bottom: 10px; inset-inline-start: 10px; max-width: calc(100% - 20px); display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(0,0,0,.55); font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile .st-name .ic { width: 13px; height: 13px; }
.st-tile .st-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; background: rgba(0,0,0,.28); }
.st-tile .st-play .ic { width: 38px; height: 38px; padding: 12px; border-radius: 50%; background: rgba(0,0,0,.6); box-sizing: content-box; }
.st-tile:hover .st-play, .st-tile:focus-visible .st-play { opacity: 1; }

#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-screen-slot > #stage-screen-card:not(:fullscreen), #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-screen-slot.multi > #stage-screen-card:not(:fullscreen) { flex: 0 0 auto !important; width: var(--tw) !important; height: var(--th) !important; min-height: 0 !important; max-height: none !important; aspect-ratio: auto !important; align-self: auto !important; border: 1px solid color-mix(in srgb, var(--border-focus) 70%, transparent) !important; border-radius: 12px !important; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-screen-slot #stage-screen-card .screen-video { max-height: none !important; height: 100% !important; }

/* ---- full screen with several streams: every stream is a tile of one grid (desktop full screen and the phone full view) ---- */
#stage-screen-slot[data-sn] { --sc: 2; }
#stage-screen-slot[data-sn="1"] { --sc: 1; }
#stage-screen-slot[data-sn="5"], #stage-screen-slot[data-sn="6"], #stage-screen-slot[data-sn="7"], #stage-screen-slot[data-sn="8"], #stage-screen-slot[data-sn="9"] { --sc: 3; }
@media (orientation: portrait) { #stage-screen-slot[data-sn="2"], #stage-screen-slot[data-sn="3"] { --sc: 1; } }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen,
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi { display: grid !important; grid-template-columns: repeat(var(--sc), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px; padding: 8px; box-sizing: border-box; background: #000; width: 100%; height: 100%; align-content: stretch; }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen { position: fixed; inset: 0; }
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi { padding: 0 8px; }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen #multi-streams,
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi #multi-streams { display: contents !important; }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen :is(#stage-screen-card, .ms-card),
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi :is(#stage-screen-card, .ms-card) { order: 0 !important; width: auto !important; height: auto !important; min-width: 0; min-height: 0 !important; max-width: none !important; max-height: none !important; aspect-ratio: auto !important; margin: 0 !important; flex: none !important; border-radius: var(--tile-r, 12px) !important; }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen #stage-screen-card .screen-video,
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi #stage-screen-card .screen-video { height: 100% !important; max-height: none !important; width: 100%; object-fit: contain; }
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen .st-tile,
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi .st-tile,
#voice-call-screen #voice-stage-grid #stage-screen-slot.multi:fullscreen #stream-tiles,
#voice-call-screen.vc-full #voice-stage-grid #stage-screen-slot.multi #stream-tiles { display: none !important; }
@media (prefers-reduced-motion: reduce) { #stage-screen-slot.multi .ms-card { transition: none; } }

/* ---- streams and people share one corner radius in every theme ---- */
#voice-call-screen #voice-stage-grid { --tile-r: 18px; }
:root[data-theme="system24"] #voice-call-screen #voice-stage-grid { --tile-r: 10px; }

#voice-call-screen #voice-stage-grid #stage-members > .tile,
#voice-call-screen #voice-stage-grid :is(#stage-screen-card, .ms-card, .st-tile),
#voice-call-screen #voice-stage-grid #stage-screen-slot > #stage-screen-card:not(:fullscreen),
#voice-call-screen #voice-stage-grid #stage-members.vl-wall > .tile { border-radius: var(--tile-r) !important; }
#voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) :is(#stage-screen-card, .ms-card, .st-tile) { border-radius: var(--tile-r) !important; }
:root #voice-call-screen #voice-stage-grid :is(.ms-card, .st-tile) { background-color: color-mix(in srgb, var(--bg-3) 85%, var(--bg-0)); border: 1px solid color-mix(in srgb, var(--border-focus) 70%, transparent); box-shadow: 0 12px 34px rgba(0,0,0,.34), 0 2px 6px rgba(0,0,0,.2); }

/* phone: the same flat tile as the people, and a visible play mark because there is no hover */
html.ph #voice-call-screen #voice-stage-grid :is(.ms-card, .st-tile) { border: 0 !important; background-color: #2a2a2e; box-shadow: none; }
@media (hover: none) { .st-tile .st-play { opacity: 1; background: transparent; } .st-tile .st-play .ic { width: 26px; height: 26px; padding: 12px; background: rgba(0,0,0,.55); } }
/* the same wall on a phone (only on a phone: on a desktop the wall stays centred, see stage-wall) */
@media (max-width: 700px) {
body #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) { flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; align-content: flex-start !important; align-items: flex-start !important; gap: var(--vg, 10px) !important; }
body #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) > #stage-members { display: contents !important; }
body #voice-call-screen #voice-stage-grid:has(#stage-members.vl-wall) #stage-members > .tile { width: var(--tw) !important; height: var(--th) !important; aspect-ratio: auto !important; grid-column: auto !important; }
}
