/**
 * The first-party chat — gc_plan('first-party-chat').
 *
 * PLACEMENT AND SIZE ONLY. Everything else the widget looks like is Bootstrap's: the panel is a
 * `card`, the send button a `btn`, the log's text a `text-body-secondary`, and the bubbles use
 * 5.3's colour-mode-aware `bg-primary-subtle` / `bg-body-secondary`. That is deliberate (owner,
 * 2026-11-10: *"build it as much as possible with bootstrap classes so that the design integrates
 * best with the websites"*) and it is also why there is not one dark-mode rule in this file — the
 * tokens already answer to the mode, so the chat takes each theme's palette rather than carrying
 * one of its own.
 */

.gc-chat {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	/* BELOW BOOTSTRAP'S MODAL (1055) AND OFFCANVAS (1045), above sticky page furniture. A chat
	   that floated over the booking modal would cover the thing the visitor is being asked to
	   finish. */
	z-index: 1040;
	display: flex;
	/* The launcher is FIRST in the DOM so it is first in the tab order; column-reverse then puts
	   the panel visually above it, which is where a chat panel belongs. */
	flex-direction: column-reverse;
	align-items: flex-end;
	gap: .5rem;
}

.gc-chat-launcher {
	width: 3.25rem;
	height: 3.25rem;
	padding: 0;
	font-size: 1.35rem;

	/* THE COLOUR IS NOT HERE. It is emitted inline on this stylesheet's own handle by
	   gc_chat_enqueue(), as `var(--gc-color-brand, <the resolved colour>)` — the brand variable
	   the owner asked the launcher to consume (2026-11-12), with the value PHP read from the
	   site's `color_brand` option standing behind it.

	   It used to live here as `--bs-btn-bg: var(--gc-color-brand, var(--bs-primary))`, which
	   depended on gc_dynamic_styles() having published that property at `:root` from a DIFFERENT
	   handle. Where it had not, the chain fell through to Bootstrap's primary and the bubble came
	   out blue on every site — reported from production on 2026-11-11. A stylesheet that needs a
	   second stylesheet to be correct is a stylesheet that will one day be wrong. */
}

/* The launcher dims slightly on hover instead of shifting hue, because the brand colour has no
   darker variant published alongside it and inventing one would be guessing at the brand. */
.gc-chat-launcher:hover,
.gc-chat-launcher:focus-visible {
	filter: brightness(0.92);
}

.gc-chat-panel {
	/* Fits a phone with the 1rem gutter on each side, and never grows past a comfortable column. */
	width: min(22rem, calc(100vw - 2rem));
	max-height: min(32rem, calc(100vh - 7rem));
}

.gc-chat-log {
	overflow-y: auto;
	/* The log is the only part that scrolls; the header and the composer stay put. */
	min-height: 8rem;
}

/* Grows with what is typed, up to a few lines, then scrolls — instead of a one-line box that
   hides the end of a question or a tall box that eats the log. */
.gc-chat-input {
	resize: none;
	max-height: 6rem;
}
