/*
 * systemEZI_chat.css — 12CHAT step 1b (2026-11-20)
 *
 * THEME RULE (docs/PROJECT_GUIDE.md "Build theme-aware UI"): no colours of our own.
 * Bill 2026-11-20, "more like WhatsApp": the chat background is a light shade of the body text
 * colour; THEIR bubbles are the page colour (--bs-body-bg: white on light themes) with a soft
 * shadow; MINE are light grey (a stronger body-colour tint). On dark themes the same tokens give
 * dark and lighter-grey bubbles. Ticks: delivered = the theme's grey (--bs-secondary-color),
 * read = the theme's info colour (--bs-info: blue on most themes; purple on Cosmo/Cyborg).
 * Online dot: --bs-success with a ring of the page colour.
 */
.wchat-panel .notification-body { padding: 0 !important; display: flex; flex-direction: column; }
.wchat-root { min-height: 0; flex: 1 1 auto; }
.wchat-screen { min-height: 0; }
.min-w-0 { min-width: 0; }

.wchat-avatar {
	width: 2.25rem; height: 2.25rem; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(var(--bs-body-color-rgb), .12); color: var(--bs-body-color);
	font-size: .8rem; font-weight: 600; overflow: hidden;
}
.wchat-avatar img { width: 100%; height: 100%; object-fit: cover; }

.wchat-item { color: var(--bs-body-color); }
.wchat-item:hover, .wchat-item:focus-visible { background: rgba(var(--bs-body-color-rgb), .07) !important; outline: none; }
.wchat-item:disabled { opacity: .6; }
.wchat-section { letter-spacing: .04em; font-size: .7rem; }

.wchat-scroll { background: rgba(var(--bs-body-color-rgb), .06); }
.wchat-day-pill { background: rgba(var(--bs-body-color-rgb), .10); color: var(--bs-body-color); }
.wchat-system { font-size: .78rem; }

.wchat-row { margin: 2px 0; }
.wchat-bubble {
	position: relative; max-width: 82%; padding: .35rem .6rem .25rem; border-radius: .9rem;
	color: var(--bs-body-color); word-wrap: break-word; overflow-wrap: anywhere;
}
.wchat-bubble { box-shadow: 0 1px 1.5px rgba(var(--bs-body-color-rgb), .16); }
.wchat-bubble.is-theirs { background: var(--bs-body-bg); border-bottom-left-radius: .25rem; }
.wchat-bubble.is-mine { background: rgba(var(--bs-body-color-rgb), .13); border-bottom-right-radius: .25rem; }
.wchat-bubble.is-pending { opacity: .75; }
.wchat-text { white-space: pre-wrap; }
.wchat-link { color: var(--bs-link-color); text-decoration: underline; }
.wchat-sender { color: var(--bs-link-color); }
.wchat-quote {
	border-left: 3px solid currentColor; padding: .15rem .5rem; border-radius: .25rem;
	background: rgba(var(--bs-body-color-rgb), .07); opacity: .9;
}
.wchat-meta { color: var(--bs-secondary-color); font-size: .7rem; line-height: 1.1; margin-top: 1px; }
.wchat-ticks { color: var(--bs-secondary-color); }
.wchat-ticks.is-read { color: var(--bs-info); }
.wchat-retry { font-size: .7rem; color: inherit; text-decoration: underline; }

/* the reply arrow shows on hover (and always on touch screens) */
.wchat-reply-btn { position: absolute; top: .1rem; opacity: 0; color: var(--bs-body-color) !important; }
.wchat-bubble.is-mine .wchat-reply-btn { left: -1.6rem; }
.wchat-bubble.is-theirs .wchat-reply-btn { right: -1.6rem; }
.wchat-bubble:hover .wchat-reply-btn, .wchat-reply-btn:focus-visible { opacity: .7; }
@media (hover: none) { .wchat-reply-btn { opacity: .5; } }

/* 2b: the message menu button sits in the bubble's top corner, on hover (always on touch screens) */
.wchat-more-btn {
	position: absolute; top: .1rem; right: .25rem; padding: 0 .2rem; font-size: .7rem; line-height: 1.2;
	opacity: 0; color: var(--bs-secondary-color) !important; background: inherit; border: 0; border-radius: .5rem;
}
.wchat-bubble:hover .wchat-more-btn, .wchat-more-btn:focus-visible { opacity: .9; }
@media (hover: none) { .wchat-more-btn { opacity: .55; } }
.wchat-msgmenu { position: absolute; z-index: 1060; min-width: 13rem; margin: 0; }
.wchat-msgmenu .wchat-why { max-width: 15rem; white-space: normal; }
.wchat-reacts .wchat-react {
	padding: 0 .45rem; font-size: .8rem; line-height: 1.5; border-radius: 1rem; color: var(--bs-body-color);
	background: rgba(var(--bs-body-color-rgb), .08); border: 1px solid transparent;
}
.wchat-reacts .wchat-react.is-mine { border-color: var(--bs-info); }
.wchat-reacts .wchat-react:hover { background: rgba(var(--bs-body-color-rgb), .14); }
.wchat-was { opacity: .85; white-space: pre-wrap; }
.wchat-restore { font-size: .75rem; }
.wchat-mark { background: var(--bs-highlight-bg); color: var(--bs-highlight-color, inherit); border-radius: .15rem; }
.wchat-flash { animation: wchat-flash 2.4s ease-out; }
@keyframes wchat-flash {
	0%, 40% { box-shadow: 0 0 0 3px rgba(var(--bs-info-rgb), .65); }
	100% { box-shadow: 0 1px 1.5px rgba(var(--bs-body-color-rgb), .16); }
}

.wchat-replybar { background: rgba(var(--bs-body-color-rgb), .07); }
.wchat-sharebar { background: rgba(var(--bs-info-rgb), .12); }
/* 2d: a shared record's card */
.wchat-reccard {
	padding: .4rem .55rem; border: 0; border-left: 3px solid var(--bs-primary); border-radius: .5rem;
	background: rgba(var(--bs-body-color-rgb), .07); color: var(--bs-body-color); min-width: 12rem;
}
button.wchat-reccard:hover { background: rgba(var(--bs-body-color-rgb), .12); }
.wchat-input { resize: none; max-height: 160px; overflow-y: auto; }

/* online dot on an avatar (bottom-right, ringed with the page colour so it reads on any photo) */
.wchat-av { display: inline-flex; }
.wchat-dot {
	position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%;
	background: var(--bs-success); box-shadow: 0 0 0 2px var(--bs-body-bg);
}
.wchat-dot[hidden] { display: none; }

/* the sender's photo beside their messages in a group (the slot keeps a run of messages lined up) */
.wchat-av-slot { width: 1.9rem; align-self: flex-start; }
.wchat-avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .65rem; }

/* step 1c — files on messages */
.wchat-bubble.has-file { padding: .3rem .3rem .25rem; }
.wchat-bubble.has-file .wchat-text, .wchat-bubble.has-file .wchat-meta, .wchat-bubble.has-file .wchat-sender { padding: 0 .3rem; }
.wchat-img { display: block; width: auto; height: auto; max-width: min(260px, 100%); max-height: 320px; border-radius: .6rem; cursor: zoom-in; }
.wchat-video { display: block; max-width: min(280px, 100%); max-height: 320px; border-radius: .6rem; }
.wchat-audio { display: block; width: 250px; max-width: 100%; }
.wchat-filecard { color: var(--bs-body-color); background: rgba(var(--bs-body-color-rgb), .06); min-width: 200px; max-width: 280px; }
.wchat-filecard:hover { background: rgba(var(--bs-body-color-rgb), .11); color: var(--bs-body-color); }
.wchat-drop { outline: 2px dashed var(--bs-link-color); outline-offset: -6px; }
.wchat-tool { color: var(--bs-secondary-color); }
.wchat-tool:hover { color: var(--bs-body-color); }

/* the emoji palette opens upwards from the 😊 button */
.wchat-emoji { position: absolute; bottom: 100%; left: 0; top: auto; width: 17rem; }
.wchat-emoji.show { display: grid; grid-template-columns: repeat(8, 1fr); }
.wchat-emoji-btn { font-size: 1.15rem; line-height: 1; padding: .3rem 0; }
.wchat-emoji-btn:hover { background: rgba(var(--bs-body-color-rgb), .09); }

/* 1d — the administrator menu (⋮) on the chat list */
.wchat-menu { position: absolute; right: 0; top: 100%; left: auto; min-width: 17rem; }
.wchat-toast { cursor: pointer; }

/* 2e — @mentions: the picker above the message box, and a name in a message (currentColor: right in every bubble and theme) */
.wchat-composer { position: relative; }
.wchat-mentions { position: absolute; bottom: 100%; left: .5rem; right: .5rem; top: auto; max-height: 15rem; overflow-y: auto; }
.wchat-mentions .wchat-avatar-sm { width: 1.6rem; height: 1.6rem; font-size: .7rem; }
.wchat-mention { font-weight: 600; }
.wchat-mention.is-me { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: .25rem; padding: 0 .15em; }
.wchat-at { font-weight: 700; }

/* 2f — voice notes. The player is drawn in currentColor so it reads in my bubble, theirs, and every theme. */
.wchat-voice { width: 270px; max-width: 100%; padding: .25rem .3rem; color: inherit; gap: .4rem !important; }
.wchat-voicemic { opacity: .7; }
.wchat-voiceplay { width: 2rem; height: 2rem; padding: 0; flex-shrink: 0; color: inherit; background: color-mix(in srgb, currentColor 16%, transparent); border: 0; }
.wchat-voiceplay:hover, .wchat-voiceplay:focus-visible { color: inherit; background: color-mix(in srgb, currentColor 26%, transparent); }
.wchat-voicebar { background: color-mix(in srgb, currentColor 22%, transparent); }
.wchat-voicebar { min-width: 5rem; }
.wchat-voicebar .progress-bar { color: inherit; background: currentColor; transition: width .2s linear; }
.wchat-voicetime { min-width: 2.4rem; font-variant-numeric: tabular-nums; }
.wchat-voicespeed { color: inherit; font-size: .75rem; font-weight: 600; padding: .15rem .3rem; flex-shrink: 0; }
.wchat-voicespeed:hover { color: inherit; }
.wchat-recbar { min-height: 2.6rem; }
.wchat-rectime { font-variant-numeric: tabular-nums; min-width: 2.6rem; }
.wchat-recdot { font-size: .7rem; animation: wchat-recblink 1s steps(2, start) infinite; }
.wchat-recdot.is-paused { animation: none; opacity: .4; }
@keyframes wchat-recblink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .wchat-recdot { animation: none; } }

/* 2g — calls. The card is drawn in currentColor (right in my bubble, theirs and every theme); the ring is a
   Bootstrap card fixed at the top right, above the chat panel. */
.wchat-call { min-width: 220px; max-width: 290px; padding: .2rem .25rem; }
.wchat-callic { width: 2.2rem; height: 2.2rem; background: color-mix(in srgb, currentColor 16%, transparent); }
.wchat-calljoin { align-self: center; }
.wchat-ring { position: fixed; top: 1rem; right: 1rem; z-index: 9990; width: min(24rem, calc(100vw - 2rem)); }
.wchat-ringic { width: 2.6rem; height: 2.6rem; animation: wchat-ringpulse 1.2s ease-in-out infinite; }
@keyframes wchat-ringpulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .wchat-ringic { animation: none; } }

/* 2h: the mark on a message made into a Task (theme-aware: the bubble's own text colour) */
.wchat-taskmark { color: inherit; opacity: .8; text-decoration: none; font-size: .8rem; }
.wchat-taskmark:hover, .wchat-taskmark:focus-visible { opacity: 1; text-decoration: underline; color: inherit; }
