/* Messages (chat.js): the panel, shared charts and calls. Same tokens as style.css. */
.panel.msgPanel { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.msgTop { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.msgSearch { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 0 8px; min-width: 0; }
.msgSearch svg { width: 16px; height: 16px; color: var(--muted); }
.msgSearch input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; outline: none; }
.msgSearch:focus-within { border-color: var(--accent); }
.msgIcon { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink); flex: none; }
.msgIcon:hover { background: var(--pane2); }
.msgIcon:focus-visible, .msgRow:focus-visible, .msgChips button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.msgMe { border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 50%; }
.msgChips { display: flex; gap: 4px; padding: 0 10px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.msgChips button { border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 4px 10px; cursor: pointer; white-space: nowrap; font-size: calc(12px + var(--fs-up)); color: var(--ink); }
.msgChips button.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.msgConn { margin: 0 10px 6px; padding: 5px 8px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); font-size: calc(12px + var(--fs-up)); }
.msgNotif { margin: 0 10px 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink2); font-size: calc(12px + var(--fs-up)); display: flex; align-items: center; gap: 10px; }
.msgNotif > span { flex: 1; }
.msgNotif button { flex: none; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 6px; padding: 5px 12px; font-weight: 600; cursor: pointer; }
.msgNotif.off { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.msgList { overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msgRow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink); width: 100%; }
.msgRow:hover { background: var(--pane2); }
.msgRow.locked { opacity: 0.55; cursor: default; }
.msgRow.locked:hover { background: transparent; }
.msgRow.locked[data-paid-room] { cursor: pointer; }
.msgRowMain { display: grid; gap: 1px; min-width: 0; }
.msgRowTop { display: flex; align-items: center; gap: 5px; min-width: 0; }
.msgRowTop b { font-weight: 600; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgRowTop time { margin-left: auto; font-size: calc(11.5px + var(--fs-up)); color: var(--muted); flex: none; }
.msgRow.unread .msgRowTop time { color: var(--accent-ink); }
.msgRowComm { font-size: calc(11.5px + var(--fs-up)); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgRowLast { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: calc(12.5px + var(--fs-up)); min-width: 0; }
.msgRowLast { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; position: relative; padding-right: 30px; }
.msgRow.unread .msgRowLast { color: var(--ink); }
.msgCount { position: absolute; right: 0; top: 50%; transform: translateY(-50%); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: calc(11px + var(--fs-up)); font-weight: 600; display: grid; place-items: center; }
.msgCount.muted { background: var(--line2); }
.msgCallOn { color: var(--up); }
.msgLock { font-style: normal; font-size: 11px; }
.msgMuted svg { width: 14px; height: 14px; color: var(--muted); }
.msgAv { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--on-accent); font-weight: 600; font-size: calc(13px + var(--fs-up)); flex: none; letter-spacing: 0.02em; }
.msgAv.sq { border-radius: 10px; }
.msgAv.small { width: 30px; height: 30px; }
.msgAv.big { width: 56px; height: 56px; font-size: calc(18px + var(--fs-up)); }
.msgAv svg { width: 20px; height: 20px; }
.msgMe .msgAv { width: 30px; height: 30px; font-size: calc(11px + var(--fs-up)); }
.msgAvWrap { position: relative; display: inline-flex; }
.msgOnline { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--up); border: 2px solid var(--bg); }
.msgEmpty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 20px; color: var(--muted); }
.msgEmpty.small { padding: 24px 16px; }
.msgEmpty > svg { width: 40px; height: 40px; color: var(--accent-ink); }
.msgEmpty b { color: var(--ink2); font-size: calc(15px + var(--fs-up)); }
.msgEmpty p { margin: 0; max-width: 280px; }
.msgEmpty .primary { padding: 8px 16px; }
.msgGhost { border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 7px 12px; cursor: pointer; color: var(--ink); }
.msgGhost:hover { background: var(--pane2); }
.msgGhost.wide { margin: 10px; }
.msgDanger { border: 0; background: transparent; color: var(--down); cursor: pointer; padding: 8px 0; text-align: left; }
.msgNone { padding: 16px; margin: 0; }
.msgSetup { display: grid; gap: 10px; padding: 0 14px 16px; }
.msgSetup label, .msgSetup input { display: grid; gap: 4px; }
.msgSetup input { background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px; outline: none; }
.msgAt { display: flex !important; align-items: center; background: var(--bg); border: 1px solid var(--line2); border-radius: 6px; padding-left: 10px; }
.msgAt i { font-style: normal; color: var(--muted); }
.msgAt input { border: 0 !important; flex: 1; background: transparent; padding: 8px 10px 8px 2px; outline: none; }

/* a chat */
.msgHead { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 4px; border-bottom: 1px solid var(--line); flex: none; }
.msgHead .msgAv { width: 34px; height: 34px; }
.msgHeadName { display: grid; flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 0; cursor: pointer; color: var(--ink); }
.msgHeadName b { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgHeadName small { color: var(--muted); font-size: calc(12px + var(--fs-up)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgCallBar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); font-size: calc(12.5px + var(--fs-up)); flex: none; }
.msgCallBar button { border: 1px solid var(--line2); background: var(--pane); border-radius: 6px; padding: 4px 12px; cursor: pointer; color: var(--ink); }
.msgCallBar .primary { background: var(--up); border: 0; color: var(--on-accent); }
.msgCallBar .msgCallPlan { color: var(--muted); text-align: right; }
.msgCallBar .msgCallPlan a { color: var(--up); white-space: nowrap; }
.msgLog { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.msgDayGrp { display: flex; flex-direction: column; gap: 2px; }
.msgDay { display: flex; justify-content: center; margin: 10px 0 6px; position: sticky; top: 0; z-index: 1; pointer-events: none; }
.msgDay span { pointer-events: auto; background: var(--pane2); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: calc(11.5px + var(--fs-up)); }
.msgSys { align-self: center; color: var(--muted); font-size: calc(12px + var(--fs-up)); padding: 4px 8px; text-align: center; }
.msg { display: flex; align-items: flex-end; gap: 6px; margin-top: 6px; position: relative; max-width: 100%; }
.msg.cont { margin-top: 1px; }
.msg.mine { flex-direction: row-reverse; }
.msg .msgAv { width: 28px; height: 28px; font-size: calc(10.5px + var(--fs-up)); }
.msgAvGap { width: 28px; flex: none; }
.msgBubble { background: var(--pane); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 4px; max-width: min(86%, 520px); min-width: 0; position: relative; }
.msg.mine .msgBubble { background: var(--mine); border-color: var(--mine-line); }
.msg.cont:not(.mine) .msgBubble { border-top-left-radius: 6px; }
.msg.cont.mine .msgBubble { border-top-right-radius: 6px; }
.msg.pending .msgBubble { opacity: 0.6; }
.msg.flash .msgBubble { box-shadow: 0 0 0 2px var(--sel); transition: box-shadow 0.3s; }
.msgName { display: block; font-size: calc(12px + var(--fs-up)); margin-bottom: 1px; }
.msgText { white-space: normal; overflow-wrap: anywhere; color: var(--ink2); }
.msgText a { color: var(--accent-ink); }
.msgDel { color: var(--muted); }
.msgMeta { display: block; text-align: right; font-size: calc(10.5px + var(--fs-up)); color: var(--muted); margin-top: 1px; }
.msg.mine .msgMeta { color: var(--muted); }
/* message ticks on your own messages (chat.js TICK): grey one / two, two in the accent once read, red when not sent */
.msgTick { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--muted); }
.msgTick svg { width: 14px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.msgTick.delivered svg, .msgTick.read svg { width: 18px; }
.msgTick.read { color: var(--accent-ink); }
.msgTick.read svg { stroke-width: 1.9; }
.msgTick.clock svg { stroke-width: 1.4; }
.msgTick.failed { color: var(--down-ink); }
.msg.failed .msgBubble { border-color: color-mix(in srgb, var(--down) 55%, transparent); }
.msgFail { color: var(--down-ink); font-weight: 600; }
.msgRetry { border: 0; background: transparent; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; padding: 0 0 0 8px; }
.msgRetry:hover { text-decoration: underline; }
.msgRetry:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
/* Message info */
.msgInfo { display: grid; gap: 12px; padding: 4px 16px 14px; max-height: min(70vh, 560px); overflow-y: auto; }
.msgInfoMsg { justify-self: end; max-width: 90%; background: var(--mine); border: 1px solid var(--mine-line); border-radius: 12px; padding: 6px 10px 4px; display: grid; }
.msgInfoMsg span { color: var(--ink2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.msgInfoMsg small { display: flex; justify-content: flex-end; align-items: center; color: var(--muted); font-size: calc(10.5px + var(--fs-up)); }
.msgInfoSect { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.msgInfoSect h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; font-size: calc(12.5px + var(--fs-up)); color: var(--ink); font-weight: 600; }
.msgInfoSect h4 .msgTick { margin-left: 0; vertical-align: 0; }
.msgInfoSect h4 small { color: var(--muted); font-weight: 400; }
.msgInfoSect .msgPerson time { color: var(--muted); font-size: calc(11.5px + var(--fs-up)); white-space: nowrap; }
.msgInfoDm { margin: 0; color: var(--ink2); }
.msgInfo > .fine { margin: 0; }
.msgQuote { display: grid; border: 0; border-left: 3px solid var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 10%, transparent); border-radius: 4px; padding: 3px 8px; margin: 2px 0 4px; text-align: left; cursor: pointer; color: var(--ink); font-size: calc(12px + var(--fs-up)); max-width: 100%; }
.msgQuote b { color: var(--accent-ink); font-size: calc(11.5px + var(--fs-up)); }
.msgReacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.msgReact { border: 1px solid var(--line2); background: var(--bg); border-radius: 999px; padding: 0 7px; cursor: pointer; font-size: calc(12px + var(--fs-up)); line-height: 22px; color: var(--ink); }
.msgReact.on { border-color: var(--accent-ink); background: var(--accent-soft); }
.msgTools { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; align-self: center; }
.msg:hover .msgTools, .msg:focus-within .msgTools { opacity: 1; }
.msgTools button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--muted); }
.msgTools button:hover { background: var(--pane2); color: var(--ink); }
.msgTools svg { width: 16px; height: 16px; }
@media (hover: none) { .msgTools { opacity: 1; } }
/* phones (chat.js MSG_PHONE_Q): no buttons beside the messages; hold one for its reactions and menu, swipe it right to
   reply. The bubble's text isn't selectable there (a long press is the menu): its menu copies it */
@media (hover: none) and (max-width: 640px), (hover: none) and (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  .msgTools { display: none; }
  .msgLog .msg { touch-action: pan-y; }
  .msgLog .msgBubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .msgBubble { max-width: min(88%, 520px); }
}
.msg.swiping > :not(.msgSwipe) { transform: translateX(var(--sx, 0px)); }
.msg.swipeBack > :not(.msgSwipe) { transition: transform 0.18s ease-out; }
.msgSwipe { position: absolute; left: 4px; top: 50%; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--pane2); color: var(--muted); opacity: 0; transform: translateY(-50%) scale(0.6); pointer-events: none; }
.msgSwipe svg { width: 17px; height: 17px; }
.msgSwipe.go { background: var(--accent-soft); color: var(--accent-ink); }
.msgSheet { position: fixed; inset: 0; z-index: 58; background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
.msgSheet > * { position: fixed; }
.msgSheetMsg { margin: 0; overflow: hidden; pointer-events: none; display: flex; }
.msgSheetMsg .msgBubble { max-width: none; width: 100%; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.msgSheetMsg.cut { -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.msgSheetReacts { display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--pane); border: 1px solid var(--line2); border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); max-width: calc(100vw - 20px); }
.msgSheetReacts button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); padding: 0; }
.msgSheetReacts button.on { background: var(--accent-soft); }
.msgSheetReacts button.more { background: var(--pane2); color: var(--muted); }
.msgSheetReacts button.more svg { width: 18px; height: 18px; }
.msgSheetMenu { min-width: 200px; max-width: calc(100vw - 20px); background: var(--pane); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); padding: 4px 0; display: grid; }
.msgSheetMenu button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: calc(14.5px + var(--fs-up)); text-align: left; cursor: pointer; }
.msgSheetMenu button + button { border-top: 1px solid var(--line); }
.msgSheetMenu button svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.msgSheetMenu button.danger, .msgSheetMenu button.danger svg { color: var(--down-ink); }
.msgSheetMenu button:active, .msgSheetReacts button:active { background: var(--pane2); }
.msgSheet.in .msgSheetReacts, .msgSheet.in .msgSheetMenu { animation: msgSheetIn 0.16s ease-out; }
@keyframes msgSheetIn { from { opacity: 0; transform: scale(0.94); } }
@media (prefers-reduced-motion: reduce) { .msgSheet.in .msgSheetReacts, .msgSheet.in .msgSheetMenu { animation: none; } .msg.swipeBack > :not(.msgSwipe) { transition: none; } }
.msgLink { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); background: var(--bg); border-radius: 6px; padding: 2px 8px; cursor: pointer; color: var(--accent-ink); }
.msgLink svg { width: 14px; height: 14px; }
.msgChart { display: grid; gap: 4px; width: 250px; max-width: 100%; border: 1px solid var(--line2); background: var(--bg); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--ink); margin: 2px 0 4px; }
.msgChart:hover { border-color: var(--accent-ink); }
.msgChartTop { display: flex; align-items: center; gap: 6px; }
.msgChartTop b { color: var(--ink2); font-size: calc(14px + var(--fs-up)); }
.msgChartTop span { color: var(--muted); }
.msgChartTop i { margin-left: auto; font-style: normal; font-size: calc(11px + var(--fs-up)); border: 1px solid var(--line2); border-radius: 4px; padding: 0 6px; color: var(--muted); }
.msgChartTop i.live { color: var(--down); border-color: color-mix(in srgb, var(--down) 50%, transparent); }
.msgChartTop i.live::before { content: "● "; }
.msgChartTitle { color: var(--ink2); font-weight: 500; }
.msgSpark { width: 100%; height: 30px; }
.msgSpark path { stroke: var(--accent-ink); stroke-width: 1.6; fill: none; }
.msgChartFoot { display: flex; align-items: center; gap: 4px; color: var(--accent-ink); font-size: calc(12px + var(--fs-up)); }
.msgChartFoot svg { width: 14px; height: 14px; }
/* pictures and PDFs in messages (chat.js fileCard); the full view (openPicView) */
.msgPic { display: block; max-width: 100%; padding: 0; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: var(--pane2); cursor: zoom-in; margin: 2px 0 4px; position: relative; }
.msgPic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msgPic img:not([src]) { visibility: hidden; }
.msgPic.gone { cursor: default; }
.msgPic.gone::after { content: "Picture unavailable"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: calc(12px + var(--fs-up)); }
.msgPic:disabled { cursor: progress; }
.msgPic:focus-visible, .msgFile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.msgFile { display: flex; align-items: center; gap: 8px; width: 250px; max-width: 100%; border: 1px solid var(--line2); background: var(--bg); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--ink); margin: 2px 0 4px; }
.msgFile:hover:not(:disabled) { border-color: var(--accent-ink); }
.msgFile i, .msgAtt i { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--down) 16%, transparent); color: var(--down); }
.msgFile i svg, .msgAtt i svg { width: 20px; height: 20px; }
.msgFile span { display: grid; min-width: 0; }
.msgFile b { color: var(--ink2); font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msgFile small { color: var(--muted); }
.msgAttach { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; }
.msgAtt { position: relative; flex: none; width: 64px; display: grid; gap: 2px; justify-items: center; }
.msgAtt img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); display: block; }
.msgAtt i { width: 64px; height: 64px; border-radius: 8px; }
.msgAtt small { width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: calc(10.5px + var(--fs-up)); text-align: center; }
.msgAtt .x { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); background: var(--pane); color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; line-height: 1; }
.msgLog.msgDrop { outline: 2px dashed var(--accent); outline-offset: -6px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.msgPicView { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.86); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 16px 20px; outline: none; }
.msgPicView img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; border-radius: 4px; min-width: 0; min-height: 0; }
.msgPicView .pvBar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #f1f4f1; }
.msgPicView .pvBar span { flex: 1; display: grid; min-width: 0; }
.msgPicView .pvBar small { color: #b5beb9; }
.msgPicView .pvBar button { border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; color: #f1f4f1; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
.msgPicView .pvBar .x { font-size: 20px; line-height: 1; padding: 3px 10px; }
.msgPicView .pvCap { color: #f1f4f1; max-width: 640px; text-align: center; margin: 0; }
.msgPicView .pvCap a { color: #4fdba6; }
.msgAlert, .msgLiveCard { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.msgAlert > svg { width: 20px; height: 20px; color: var(--warn); }
.msgAlert span, .msgLiveCard span { display: grid; flex: 1; min-width: 0; color: var(--ink2); }
.msgAlert small, .msgLiveCard small { color: var(--muted); }
.msgAlert button { border: 1px solid var(--line2); background: var(--bg); border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.msgLiveCard .primary { padding: 5px 12px; }
.msgRec { width: 10px; height: 10px; border-radius: 50%; background: var(--down); flex: none; animation: msgPulse 1.6s ease-in-out infinite; }
@keyframes msgPulse { 50% { opacity: 0.35; } }
.msgTyping { min-height: 18px; padding: 0 14px; font-size: calc(12px + var(--fs-up)); color: var(--muted); font-style: italic; flex: none; }
.msgCompose { border-top: 1px solid var(--line); padding: 6px 8px 8px; flex: none; }
.msgCtx { display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--accent-ink); padding: 2px 4px 2px 8px; margin-bottom: 6px; font-size: calc(12px + var(--fs-up)); }
.msgCtx span { flex: 1; display: grid; min-width: 0; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msgCtx b { color: var(--accent-ink); }
.msgForm { display: flex; align-items: flex-end; gap: 4px; }
.msgForm textarea { flex: 1; resize: none; background: var(--bg); border: 1px solid var(--line2); border-radius: 18px; padding: 8px 14px; outline: none; max-height: 160px; line-height: 1.4; }
.msgForm textarea:focus { border-color: var(--accent); }
.msgSend { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.msgSend:hover { background: var(--accent-hover); }
.msgReadOnly { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: calc(12.5px + var(--fs-up)); padding: 4px 4px; }
.msgReadOnly button { border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 5px 12px; cursor: pointer; color: var(--ink); }

/* a community */
.msgComm { overflow-y: auto; flex: 1; min-height: 0; padding: 10px 12px 16px; display: grid; gap: 10px; align-content: start; }
.msgComm h4 { margin: 6px 0 0; font-size: calc(11px + var(--fs-up)); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.msgComm .msgList { margin: 0 -12px; overflow: visible; min-height: auto; }   /* the community scrolls as a whole */
.msgAbout { margin: 0; color: var(--ink2); }
.msgNote { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--pane2); color: var(--muted); }
.msgPlan { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line2); border-radius: 10px; }
.msgPlan > svg { width: 22px; height: 22px; color: var(--warn); }
.msgPlan span { display: grid; flex: 1; }
.msgPlan .msgBuy { flex: none; padding: 7px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; white-space: nowrap; background: var(--accent); color: var(--on-accent); }
.msgPlan .msgBuy:hover { background: var(--accent-hover); }
.msgPlan small { color: var(--muted); }
.msgPlan { flex-wrap: wrap; }
.msgPlan .msgGhost { flex: none; }
/* paying for a membership: the lengths, the wait for PayHere, why not */
.msgPay .msgOpts, .msgPay .msgPayWait, .msgPay > small { flex-basis: 100%; }
.msgOpts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.msgOpt { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--pane2); color: var(--ink); cursor: pointer; font: inherit; }
.msgOpt b { font-size: calc(15px + var(--fs-up)); font-variant-numeric: tabular-nums; }
.msgOpt i { font-style: normal; font-weight: 600; color: var(--accent-ink); margin-top: 4px; }
.msgOpt:hover:not(:disabled) { border-color: var(--accent); }
.msgOpt:disabled { opacity: 0.55; cursor: default; }
.msgOpt:disabled i { color: var(--muted); }
.msgPayWait { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.msgPayWait > span { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msgPayWait a.msgGhost { text-decoration: none; }
.msgPlan small.msgPayTest { color: var(--warn); }
.msgPlan small.msgPayWhy { color: var(--ink2); }
.msgPlan.flash { animation: msgPayFlash 1.2s ease-out; }
@keyframes msgPayFlash { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .msgPlan.flash { animation: none; } }
.msgSuspended { border-left: 3px solid var(--down, #ef6a64); }
.msgRules { border-left: 2px solid var(--line2); padding: 2px 0 2px 10px; }
.msgRules summary { cursor: pointer; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.msgRules p { margin: 6px 0 0; white-space: pre-line; color: var(--ink2); }
#dcT { width: 100%; }
.msgAdmin { display: flex; flex-wrap: wrap; gap: 6px; }

/* dialogs */
.msgPeople { display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.msgPerson { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; background: transparent; border-radius: 8px; text-align: left; color: var(--ink); width: 100%; }
button.msgPerson { cursor: pointer; }
button.msgPerson:hover { background: var(--pane2); }
.msgPerson .msgAv { width: 32px; height: 32px; font-size: calc(11px + var(--fs-up)); }
.msgPerson > span { display: grid; flex: 1; min-width: 0; }
.msgPerson small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgPerson > button { border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--ink); }
.msgPicked { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.msgPicked span { background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-size: calc(12px + var(--fs-up)); }
.msgInvite { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 18px 16px 12px; }
.msgInvite b { font-size: calc(16px + var(--fs-up)); color: var(--ink2); }
.msgInvite p { margin: 4px 0 0; color: var(--ink); }
.msgInv { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.msgInv code { font-family: var(--mono); font-size: calc(11.5px + var(--fs-up)); overflow-wrap: anywhere; color: var(--ink2); }
.msgInv small { color: var(--muted); }
.msgInv span { display: flex; gap: 6px; }
.msgInv button { border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 3px 10px; cursor: pointer; color: var(--ink); }
.msgCheck { display: grid !important; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start; }
.msgCheck input { margin-top: 3px; accent-color: var(--accent); }
.msgCheck small { grid-column: 2; color: var(--muted); }
.msgModes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.msgModes label { display: flex !important; gap: 8px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 8px; padding: 10px; cursor: pointer; }
.msgModes label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.msgModes input { margin-top: 3px; accent-color: var(--accent); }
.msgModes span { display: grid; gap: 2px; }
.msgModes small { color: var(--muted); font-size: calc(11.5px + var(--fs-up)); }
.msgModes label.locked { cursor: default; color: var(--muted); }   /* live sharing on a plan without it */
#shQ { width: 100%; margin: 6px 0; }
.msgPick { display: grid; max-height: 30vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.msgPickRow { display: flex !important; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; }
.msgPickRow:hover { background: var(--pane2); }
.msgPickRow .msgAv { width: 30px; height: 30px; font-size: 11px; }
.msgPickRow span { display: grid; flex: 1; min-width: 0; }
.msgPickRow small { color: var(--muted); text-transform: capitalize; }
.msgPickRow input { accent-color: var(--accent); width: 16px; height: 16px; }

/* pop-ups of new messages */
/* glass cards in the top dock (style.css "pop-up notices") */
.msgToast { cursor: pointer; }
.msgToast > span { display: grid; min-width: 0; }
.msgToast b { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgToast small { color: var(--n-sub, var(--muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgToast .msgAv { width: 34px; height: 34px; }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } }

/* sharing live, shared charts */
.liveChip { display: flex; align-items: center; gap: 6px; height: calc(var(--tb-h) - 6px); padding: 0 10px; border: 1px solid color-mix(in srgb, var(--down) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--down) 8%, transparent); color: var(--down-ink); cursor: pointer; white-space: nowrap; flex: none; font-size: calc(12px + var(--fs-up)); }
.liveChip i { width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
.liveChip.air i { animation: msgPulse 1.4s ease-in-out infinite; }
.shareBar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 140px); background: color-mix(in srgb, var(--pane) 96%, transparent); border: 1px solid var(--line2); border-radius: 10px; padding: 5px 6px 5px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.shareBar .sbWho { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: 4px; }
.shareBar .sbWho .msgAv { width: 28px; height: 28px; font-size: 11px; }
.shareBar .sbWho > span { display: grid; min-width: 0; }
.shareBar .sbWho b { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(12.5px + var(--fs-up)); }
.shareBar .sbWho small { color: var(--muted); font-size: calc(11.5px + var(--fs-up)); white-space: nowrap; }
.sbLive { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--down); margin-right: 5px; animation: msgPulse 1.6s ease-in-out infinite; }
.shareBar > button:not(.x) { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line2); background: transparent; border-radius: 6px; padding: 4px 9px; cursor: pointer; white-space: nowrap; color: var(--ink); font-size: calc(12px + var(--fs-up)); }
.shareBar > button.on { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }
.shareBar > button svg { width: 14px; height: 14px; }
.tabSub.tabLive { color: var(--down-ink); }
.livePtr { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; transition: transform 0.08s linear; }
.livePtr i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #ab47bc; box-shadow: 0 0 0 4px rgba(171, 71, 188, 0.3); }
.livePtr span { position: absolute; left: 10px; top: 6px; background: #ab47bc; color: var(--on-accent); border-radius: 4px; padding: 0 6px; font-size: 11px; white-space: nowrap; }

/* calls */
.rtcWin { position: fixed; left: calc(var(--rail-w) + 16px); bottom: calc(var(--bot-h) + 16px); z-index: 46; width: 420px; max-width: calc(100vw - 32px); background: var(--bg-deep); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); overflow: hidden; display: grid; }
.rtcHead { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; cursor: move; user-select: none; }
.rtcHead b { color: var(--ink2); }
.rtcHead small { color: var(--muted); flex: 1; }
.rtcHead button { border: 0; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.rtcHead button:hover { background: var(--pane2); color: var(--ink); }
.rtcGrid { display: grid; gap: 4px; padding: 0 6px; grid-template-columns: 1fr 1fr; }
.rtcGrid.n1 { grid-template-columns: 1fr; }
.rtcTile { position: relative; background: var(--raise2); border-radius: 8px; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; }
.rtcTile.screen { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.rtcTile video { width: 100%; height: 100%; object-fit: cover; }
.rtcTile.screen video { object-fit: contain; background: #000; }
.rtcTile.me video { transform: scaleX(-1); }
.rtcName { position: absolute; left: 6px; bottom: 5px; background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 11.5px; }
.rtcBar { display: flex; justify-content: center; gap: 10px; padding: 10px; }
.rtcBar button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--pane2); color: var(--ink2); cursor: pointer; display: grid; place-items: center; }
.msgIcon.locked, .rtcBar button.locked { opacity: 0.45; }   /* video on a plan without it: says so when clicked */
.rtcBar button:hover { background: var(--line2); }
.rtcBar button.off { background: color-mix(in srgb, var(--down) 22%, var(--pane)); color: var(--down-ink); }
.rtcBar button.on { background: var(--accent); color: var(--on-accent); }
.rtcBar button.leave { background: var(--down); color: var(--on-accent); }
.rtcWin.mini { width: 250px; }
.rtcWin.mini .rtcGrid { display: none; }
/* a ringing call: a glass card at the top of the top dock (style.css "pop-up notices") */
.rtcRing { gap: 12px; padding: 12px 14px; }
.rtcRing > span { display: grid; flex: 1; min-width: 0; }
.rtcRing b { color: var(--ink2); }
.rtcRing small { color: var(--n-sub, var(--muted)); }
.rtcRing button { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--on-accent); }
.rtcNo { background: var(--down); }
.rtcYes { background: var(--up); }
@media (prefers-reduced-motion: reduce) { .msgRec, .sbLive, .liveChip.air i { animation: none; } .livePtr { transition: none; } }
@media (max-width: 900px) { .shareBar { max-width: calc(100% - 20px); flex-wrap: wrap; } .rtcWin { left: 8px; bottom: calc(var(--bot-h) + 8px); width: calc(100vw - 16px - var(--rail-w)); } }

/* watching a call big (chat.js callBig / callPop): the whole page, or a window of its own; one tile on the stage
   (a shared screen first), the others in a strip to swap in; on phones upright or on its side, pinch to zoom */
.rtcTile .rtcTileBtns { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.rtcTile:hover .rtcTileBtns, .rtcTile:focus-within .rtcTileBtns { opacity: 1; }
@media (pointer: coarse) { .rtcTile .rtcTileBtns { opacity: 1; } }
.rtcTileBtns button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.rtcTileBtns button:hover, .rtcTileBtns button:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }
.rtcTileBtns svg, .rtcAway svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rtcHead button.on { color: var(--accent-ink, var(--accent)); }
.rtcGrid .rtcTile { cursor: zoom-in; }
.rtcWin.big { left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important; width: auto; max-width: none; z-index: 100; border: 0; border-radius: 0; box-shadow: none;
  background: #000; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.rtcWin.big .rtcHead { cursor: default; background: var(--bg-deep); padding: 6px 8px 6px 14px; }
.rtcWin.big .rtcHead button { width: 34px; height: 34px; }
.rtcWin.big .rtcBar { background: var(--bg-deep); padding: 8px; }
.rtcStage { position: relative; min-height: 0; min-width: 0; display: grid; overflow: hidden; background: #000; touch-action: none; }
.rtcStage .rtcTile { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; background: #000; }
.rtcStage .rtcTile video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform; }
.rtcStage.zoomed { cursor: grab; }
.rtcStage.zoomed:active { cursor: grabbing; }
.rtcStage .rtcName { left: 12px; top: 10px; bottom: auto; font-size: 13px; padding: 2px 8px; }   /* top: a screen's bottom line (prices, status bars) stays clear */
.rtcStage .rtcTileBtns { top: 10px; right: 10px; }
.rtcStage .rtcAvatar .msgAv.big { width: 120px; height: 120px; font-size: 40px; }
.rtcStrip { display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; background: var(--bg-deep); scrollbar-width: thin; }
.rtcStrip .rtcTile { flex: none; width: 176px; aspect-ratio: 16 / 10; cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; }
.rtcStrip .rtcTile:hover, .rtcStrip .rtcTile:focus-visible { outline-color: var(--accent); }
.rtcStrip .rtcTile.screen video { object-fit: contain; }
.rtcWin.big.bare .rtcHead, .rtcWin.big.bare .rtcStrip, .rtcWin.big.bare .rtcBar, .rtcWin.big.bare .rtcStage .rtcName, .rtcWin.big.bare .rtcTileBtns { display: none; }
.rtcWin.big.bare { grid-template-rows: minmax(0, 1fr); }
html.rtcBigOn .toasts, html.rtcBigOn .rtcRing, html.rtcBigOn #modalBack { z-index: 101; }
/* phones: smaller strip tiles; on its side the strip runs down the right */
.rtcWin.big.phone .rtcStrip .rtcTile { width: 112px; }
.rtcWin.big.phone .rtcHead small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (orientation: landscape) and (max-height: 520px) {
  .rtcWin.big.strip { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; }
  .rtcWin.big.strip .rtcHead { grid-column: 1 / -1; }
  .rtcWin.big.strip .rtcStage { grid-column: 1; grid-row: 2; }
  .rtcWin.big.strip .rtcStrip { grid-column: 2; grid-row: 2 / 4; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
  .rtcWin.big.strip .rtcBar { grid-column: 1; grid-row: 3; }
  .rtcWin.big .rtcStrip .rtcTile { width: 132px; }
  .rtcWin.big .rtcHead { padding-top: 2px; padding-bottom: 2px; }
  .rtcWin.big .rtcBar { padding: 4px; }
  .rtcWin.big .rtcBar button { width: 38px; height: 38px; }
}
/* the call's own window (a pop-up the chart page fills) */
body.rtcPopBody { margin: 0; height: 100vh; overflow: hidden; background: #000; }
.rtcWin.popped { position: fixed; }
/* the chart window while the call is in its own window */
.rtcAway { position: fixed; left: calc(var(--rail-w) + 16px); bottom: calc(var(--bot-h) + 16px); z-index: 46; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px;
  background: var(--bg-deep); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.rtcAway > i { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.rtcAway > span { display: grid; min-width: 0; }
.rtcAway b { color: var(--ink2); }
.rtcAway small { color: var(--muted); }
.rtcAway button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--pane2); color: var(--ink2); cursor: pointer; display: grid; place-items: center; }
.rtcAway button:hover { background: var(--line2); }
.rtcAway button.off { background: color-mix(in srgb, var(--down) 22%, var(--pane)); color: var(--down-ink); }
.rtcAway button.leave { background: var(--down); color: var(--on-accent); }
.msgDlg .primary { background: var(--accent); color: var(--on-accent); border: 0; }
.msgDlg .primary:hover { background: var(--accent-hover); }
.msgDlg .primary:disabled { opacity: 0.6; }
.msgPickRow span, .msgPerson > span { text-align: left; }
.msgDlg input[type="checkbox"], .msgDlg input[type="radio"] { width: 16px; height: 16px; flex: none; padding: 0; }
.msgDlg .msgPickRow, .msgDlg .msgModes label, .msgDlg .msgCheck { color: var(--ink); font-size: calc(13px + var(--fs-up)); }
.msgDlg .msgModes b { color: var(--ink2); }
.msgPickRow .msgAvWrap, .msgRow .msgAvWrap, .msgHead .msgAvWrap { flex: none; display: inline-flex; }
.msgAlert { display: grid; gap: 4px; justify-items: start; }
.msgAlertHead { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.msgAlertHead svg { width: 16px; height: 16px; }
.msgAlertText { color: var(--ink2); }
.msgAlertText small { color: var(--muted); }
.shareBar { top: auto; bottom: 36px; }
.rtcGrid { max-height: 62vh; overflow-y: auto; }
.msgPickRow .msgAv, .msgRow .msgAv, .msgPerson .msgAv { flex: none; }

/* the emoji picker (message box and reactions), styled as the page's menus */
.emojiPick { position: fixed; z-index: 60; width: 336px; max-width: calc(100vw - 12px); background: var(--pane); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); padding: 8px; display: grid; gap: 6px; }
.emojiPick[hidden] { display: none; }
.emojiQ { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 10px; outline: none; }
.emojiQ:focus { border-color: var(--accent); }
.emojiTabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.emojiTabs.dim { opacity: 0.45; }
.emojiTabs button { flex: 1; height: 30px; border: 0; background: transparent; border-radius: 6px; font-size: 17px; line-height: 1; cursor: pointer; filter: grayscale(0.6); opacity: 0.7; }
.emojiTabs button:hover { background: var(--pane2); opacity: 1; filter: none; }
.emojiTabs button.on { opacity: 1; filter: none; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.emojiGrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; height: 236px; overflow-y: auto; align-content: start; }
.emojiGrid button { aspect-ratio: 1; border: 0; background: transparent; border-radius: 6px; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.emojiGrid button:hover, .emojiGrid button:focus-visible { background: var(--pane2); outline: none; }
.emojiGrid .flagImg { width: 1em; height: 1em; vertical-align: middle; }
/* a flag in a message keeps a little room from the emoji beside it (an emoji glyph can be wider than its own space) */
.msgText .flagImg, .msgQuote .flagImg { margin: 0 0.1em; }
.emojiNone { grid-column: 1 / -1; color: var(--muted); font-size: calc(12.5px + var(--fs-up)); padding: 12px 4px; }
/* a message of one to three emoji only */
.msgText.big { font-size: 2.4em; line-height: 1.15; }

/* profile pictures: built-in avatars, photos (initials stay underneath until it loads), the picture editor */
.msgAv.av { color: #fff; }
.msgAv.av svg { width: 80%; height: 80%; }
.msgAv.ph { position: relative; overflow: hidden; }
.msgAv.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.msgAv.fill { width: 100%; height: 100%; font-size: inherit; }
.accountBtn:has(.msgAv) { padding: 0; overflow: hidden; }
.acctPop button.acAv { position: relative; border: 0; padding: 0; cursor: pointer; }
.acctPop button.acAv .msgAv { border-radius: 50%; }
.acctPop .acPen { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--pane2); color: var(--ink); border: 2px solid var(--pane); }
.acctPop .acPen svg { width: 12px; height: 12px; }
.acctPop button.acAv:hover .acPen, .acctPop button.acAv:focus-visible .acPen { background: var(--accent); color: var(--on-accent); }
.rtcAvatar .msgAv.big, .msgToast .msgAv.big { overflow: hidden; }
.picNow { display: flex; align-items: center; gap: 12px; }
.picNow > span { display: grid; min-width: 0; }
.picNow b { color: var(--ink2); }
.picNow small { color: var(--muted); }
.picEd { display: grid; gap: 12px; padding: 4px 16px 16px; }
.picBtns { display: flex; flex-wrap: wrap; gap: 8px; }
.picBtns button:not(.primary), .picNow > button { padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line2); background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.picBtns button:not(.primary):hover, .picNow > button:hover { background: var(--pane2); }
.picBtns .primary { padding: 8px 14px; }
.picEd .fine { margin: 0; }
.picGrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.picGrid button { padding: 3px; border: 2px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; }
.picGrid button:hover { border-color: var(--line3); }
.picGrid button.on { border-color: var(--accent); }
.picGrid .msgAv { width: 100%; height: auto; aspect-ratio: 1; }
.picStage { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 10px; background: var(--bg-deep); cursor: grab; touch-action: none; user-select: none; }
.picStage.dragging { cursor: grabbing; }
.picStage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.picStage::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55); pointer-events: none; }
.picStage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picHint { text-align: center; }
.picZoom { display: flex; align-items: center; gap: 10px; }
.picZoom input { flex: 1; }
@media (max-width: 480px) { .picGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
