/**
 * TryVue — AI Shopping Assistant (storefront widget) styles.
 *
 * Enterprise, fully self-contained styling scoped under #tryvue-chat-root so it
 * never inherits or leaks into the host theme. Accent-driven via CSS custom
 * properties (set at runtime by tryvue-chat.js), light/dark via [data-theme].
 *
 * Layout philosophy (Claude / ChatGPT level):
 *   - Desktop/laptop: a compact floating panel anchored bottom-right with a
 *     sensible max-width/height, a sticky header, a flex-column scrollable
 *     message list, and a compact auto-growing composer.
 *   - Mobile: a full-height bottom-sheet using 100dvh + safe-area insets so it
 *     NEVER overflows the viewport and the header/composer are never clipped.
 *
 * @package TryVue
 */

/* ── Root + design tokens (light default) ──────────────────────────────── */
#tryvue-chat-root {
	--tvc-accent-from: #7c3aed;
	--tvc-accent-to: #a855f7;
	--tvc-accent: var(--tvc-accent-from);
	--tvc-accent-grad: linear-gradient(135deg, var(--tvc-accent-from), var(--tvc-accent-to));
	--tvc-accent-glow: rgba(124, 58, 237, .28);
	--tvc-accent-ring: rgba(124, 58, 237, .18);

	--tvc-surface: #ffffff;
	--tvc-surface-2: #f7f8fb;
	--tvc-surface-3: #eef0f6;
	--tvc-border: #e5e8f0;
	--tvc-border-soft: #eef0f6;
	--tvc-text: #16181f;
	--tvc-text-soft: #464c58;
	--tvc-muted: #7b8291;
	--tvc-on-accent: #ffffff;
	--tvc-user-bubble: var(--tvc-accent-grad);
	--tvc-user-text: #ffffff;
	--tvc-bot-bubble: #f0f1f6;
	--tvc-bot-text: #1a1d24;

	--tvc-radius: 20px;
	--tvc-radius-sm: 12px;
	--tvc-radius-xs: 9px;
	--tvc-shadow: 0 18px 50px rgba(16, 24, 40, .20), 0 4px 12px rgba(16, 24, 40, .08);
	--tvc-shadow-sm: 0 2px 8px rgba(16, 24, 40, .08);

	/* Panel geometry — tweak once, applies everywhere. */
	--tvc-panel-w: 400px;
	--tvc-panel-h: min(640px, calc(100vh - 40px));
	--tvc-edge: 20px;

	position: fixed;
	right: var(--tvc-edge);
	bottom: var(--tvc-edge);
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--tvc-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ── Dark theme ────────────────────────────────────────────────────────── */
#tryvue-chat-root[data-theme="dark"] {
	--tvc-accent-glow: rgba(139, 92, 246, .40);
	--tvc-accent-ring: rgba(167, 139, 250, .3);

	--tvc-surface: #161923;
	--tvc-surface-2: #12141c;
	--tvc-surface-3: #232833;
	--tvc-border: #2c313c;
	--tvc-border-soft: #232833;
	--tvc-text: #f2f4f9;
	--tvc-text-soft: #c4cbd8;
	--tvc-muted: #8b93a3;
	--tvc-bot-bubble: #232833;
	--tvc-bot-text: #eef0f6;

	--tvc-shadow: 0 20px 56px rgba(0, 0, 0, .62), 0 4px 14px rgba(0, 0, 0, .4);
	--tvc-shadow-sm: 0 2px 10px rgba(0, 0, 0, .4);
}

#tryvue-chat-root,
#tryvue-chat-root * { box-sizing: border-box; }

#tryvue-chat-root :focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--tvc-accent-ring);
}

/* ── Launcher ──────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-launcher {
	position: absolute;
	right: 0;
	bottom: 0;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 58px;
	padding: 0 22px 0 18px;
	border: none;
	border-radius: 999px;
	background: var(--tvc-accent-grad);
	color: var(--tvc-on-accent);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 30px var(--tvc-accent-glow);
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
	white-space: nowrap;
}
#tryvue-chat-root .tvc-launcher:hover { transform: translateY(-2px) scale(1.02); }
#tryvue-chat-root .tvc-launcher:active { transform: translateY(0) scale(.99); }
#tryvue-chat-root .tvc-launcher__icon { display: inline-flex; }
#tryvue-chat-root .tvc-launcher__label { line-height: 1; }

#tryvue-chat-root.is-open .tvc-launcher {
	opacity: 0;
	pointer-events: none;
	transform: scale(.7);
}

/* ── Panel ─────────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: var(--tvc-panel-w);
	max-width: calc(100vw - (var(--tvc-edge) * 2));
	height: var(--tvc-panel-h);
	max-height: calc(100vh - (var(--tvc-edge) * 2));
	display: flex;
	flex-direction: column;
	background: var(--tvc-surface);
	border: 1px solid var(--tvc-border);
	border-radius: var(--tvc-radius);
	box-shadow: var(--tvc-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity .22s ease, transform .22s ease;
}
#tryvue-chat-root.is-open .tvc-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* ── Header ────────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--tvc-accent-grad);
	color: #fff;
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-header__brand {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	flex: 1;
}
#tryvue-chat-root .tvc-header__mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: rgba(255, 255, 255, .18);
	color: #fff;
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-header__meta { display: flex; flex-direction: column; min-width: 0; }
#tryvue-chat-root .tvc-header__meta strong {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#tryvue-chat-root .tvc-header__status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	opacity: .9;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#tryvue-chat-root .tvc-header__status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-header__actions { display: flex; gap: 4px; flex-shrink: 0; }
#tryvue-chat-root .tvc-iconbtn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 9px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
}
#tryvue-chat-root .tvc-iconbtn:hover { background: rgba(255, 255, 255, .26); }

/* ── Messages ──────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--tvc-surface-2);
	scrollbar-width: thin;
	scrollbar-color: var(--tvc-border) transparent;
}
#tryvue-chat-root .tvc-messages::-webkit-scrollbar { width: 9px; }
#tryvue-chat-root .tvc-messages::-webkit-scrollbar-thumb {
	background: var(--tvc-border);
	border-radius: 999px;
	border: 2px solid var(--tvc-surface-2);
}

#tryvue-chat-root .tvc-msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
#tryvue-chat-root .tvc-msg--user { align-items: flex-end; }
#tryvue-chat-root .tvc-msg--assistant { align-items: flex-start; }

#tryvue-chat-root .tvc-bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 18px;
	font-size: 14.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
#tryvue-chat-root .tvc-msg--user .tvc-bubble {
	background: var(--tvc-user-bubble);
	color: var(--tvc-user-text);
	border-bottom-right-radius: 6px;
	box-shadow: 0 3px 10px var(--tvc-accent-glow);
}
#tryvue-chat-root .tvc-msg--assistant .tvc-bubble {
	background: var(--tvc-bot-bubble);
	color: var(--tvc-bot-text);
	border-bottom-left-radius: 6px;
}
/* Clean spacing for multi-paragraph assistant replies. */
#tryvue-chat-root .tvc-bubble > p { margin: 0; }
#tryvue-chat-root .tvc-bubble > p + p { margin-top: 8px; }

/* ── Rendered Markdown inside the assistant bubble ─────────────────────
   The assistant answers in lightweight Markdown; renderMarkdown() turns it
   into these whitelisted tags. Styled for a crisp, scannable, on-brand look. */
#tryvue-chat-root .tvc-bubble--md { line-height: 1.55; white-space: normal; }

#tryvue-chat-root .tvc-bubble--md > *:first-child { margin-top: 0; }
#tryvue-chat-root .tvc-bubble--md > *:last-child { margin-bottom: 0; }
#tryvue-chat-root .tvc-bubble--md strong { font-weight: 700; color: inherit; }
#tryvue-chat-root .tvc-bubble--md em { font-style: italic; }
#tryvue-chat-root .tvc-bubble--md code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
	padding: 1px 5px;
	border-radius: 5px;
	background: rgba(127, 127, 127, 0.16);
}
#tryvue-chat-root .tvc-bubble--md a {
	color: var(--tvc-accent-to, #a855f7);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}
#tryvue-chat-root .tvc-bubble--md .tvc-md-list {
	margin: 8px 0;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
#tryvue-chat-root .tvc-bubble--md .tvc-md-list li { margin: 0; padding-left: 2px; }
#tryvue-chat-root .tvc-bubble--md ul.tvc-md-list { list-style: disc; }
#tryvue-chat-root .tvc-bubble--md ol.tvc-md-list { list-style: decimal; }
#tryvue-chat-root .tvc-bubble--md .tvc-md-list li::marker { color: var(--tvc-accent-to, #a855f7); }


/* ── AI Vision: shopper's attached photo thumbnail (in a user message) ─── */
#tryvue-chat-root .tvc-msg__photo {
	max-width: 68%;
	border-radius: 16px;
	border-bottom-right-radius: 6px;
	overflow: hidden;
	background: var(--tvc-surface-3);
	box-shadow: 0 3px 10px rgba(16, 24, 40, .14);
}
#tryvue-chat-root .tvc-msg__photo img {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: cover;
}

/* Typing indicator */
#tryvue-chat-root .tvc-bubble--typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }

#tryvue-chat-root .tvc-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tvc-muted);
	animation: tvc-bounce 1.3s infinite ease-in-out both;
}
#tryvue-chat-root .tvc-dot:nth-child(1) { animation-delay: -.32s; }
#tryvue-chat-root .tvc-dot:nth-child(2) { animation-delay: -.16s; }
@keyframes tvc-bounce {
	0%, 80%, 100% { transform: scale(.6); opacity: .5; }
	40% { transform: scale(1); opacity: 1; }
}

/* ── Product cards ─────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-products {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	max-width: 92%;
}
#tryvue-chat-root .tvc-product {
	display: flex;
	gap: 12px;
	padding: 10px;
	background: var(--tvc-surface);
	border: 1px solid var(--tvc-border);
	border-radius: var(--tvc-radius-sm);
	box-shadow: var(--tvc-shadow-sm);
	transition: border-color .15s, transform .12s;
}
#tryvue-chat-root .tvc-product:hover { border-color: var(--tvc-accent); transform: translateY(-1px); }
#tryvue-chat-root .tvc-product__thumb {
	flex-shrink: 0;
	width: 68px;
	height: 68px;
	border-radius: var(--tvc-radius-xs);
	overflow: hidden;
	background: var(--tvc-surface-3);
	display: block;
}
#tryvue-chat-root .tvc-product__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#tryvue-chat-root .tvc-product__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#tryvue-chat-root .tvc-product__title {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--tvc-text);
	text-decoration: none;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
#tryvue-chat-root .tvc-product__title:hover { color: var(--tvc-accent); }
#tryvue-chat-root .tvc-product__reason {
	margin: 0;
	font-size: 12px;
	color: var(--tvc-muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
#tryvue-chat-root .tvc-product__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#tryvue-chat-root .tvc-product__price { font-size: 13.5px; font-weight: 700; color: var(--tvc-text); }
#tryvue-chat-root .tvc-product__stock { font-size: 11px; font-weight: 600; color: #c81e1e; }
#tryvue-chat-root .tvc-product__actions { display: flex; gap: 7px; align-items: center; margin-top: 4px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 7px 14px;
	border-radius: 9px;
	border: 1px solid var(--tvc-border);
	background: var(--tvc-surface-2);
	color: var(--tvc-text);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: filter .15s, background .15s, border-color .15s, transform .1s;
	white-space: nowrap;
}
#tryvue-chat-root .tvc-btn:active { transform: translateY(1px); }
#tryvue-chat-root .tvc-btn--primary {
	background: var(--tvc-accent-grad);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 4px 12px var(--tvc-accent-glow);
}
#tryvue-chat-root .tvc-btn--primary:hover { filter: brightness(1.06); }
#tryvue-chat-root .tvc-btn--primary.is-added { background: #12813e; box-shadow: none; }
#tryvue-chat-root .tvc-btn--ghost { background: transparent; }
#tryvue-chat-root .tvc-btn--ghost:hover { background: var(--tvc-surface-2); border-color: var(--tvc-muted); }
#tryvue-chat-root .tvc-cartlink {
	font-size: 12px;
	font-weight: 700;
	color: var(--tvc-accent);
	text-decoration: none;
	padding: 6px 4px;
}
#tryvue-chat-root .tvc-cartlink:hover { text-decoration: underline; }

/* ── AI Vision: attachment preview chip (above the composer) ───────────── */
#tryvue-chat-root .tvc-attach {
	display: none;
	padding: 10px 12px 0;
	background: var(--tvc-surface);
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-attach.is-active { display: block; }
#tryvue-chat-root .tvc-attach__chip {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	max-width: 100%;
	padding: 6px 6px 6px 6px;
	border: 1px solid var(--tvc-border);
	border-radius: 12px;
	background: var(--tvc-surface-2);
	box-shadow: var(--tvc-shadow-sm);
}
#tryvue-chat-root .tvc-attach__thumb {
	width: 42px;
	height: 42px;
	border-radius: 9px;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
	background: var(--tvc-surface-3);
}
#tryvue-chat-root .tvc-attach__label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--tvc-text-soft);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#tryvue-chat-root .tvc-attach__remove {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: none;
	border-radius: 7px;
	background: transparent;
	color: var(--tvc-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: background .15s, color .15s;
}
#tryvue-chat-root .tvc-attach__remove:hover { background: var(--tvc-surface-3); color: var(--tvc-text); }

/* ── Composer ──────────────────────────────────────────────────────────── */
#tryvue-chat-root .tvc-composer {
	display: flex;
	align-items: flex-end;
	gap: 9px;
	padding: 10px 12px;
	background: var(--tvc-surface);
	border-top: 1px solid var(--tvc-border-soft);
	flex-shrink: 0;
}
/* Hidden native file input — triggered by the attach button. */
#tryvue-chat-root .tvc-composer__file {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
#tryvue-chat-root .tvc-composer__attach {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--tvc-border);
	border-radius: 12px;
	background: var(--tvc-surface-2);
	color: var(--tvc-text-soft);
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, transform .1s;
}
#tryvue-chat-root .tvc-composer__attach:hover {
	background: var(--tvc-surface-3);
	border-color: var(--tvc-accent);
	color: var(--tvc-accent);
}
#tryvue-chat-root .tvc-composer__attach:active { transform: translateY(1px); }
/* Contextual: hidden until the assistant invites a photo (see JS). */
#tryvue-chat-root .tvc-composer__attach.is-hidden { display: none; }
/* Gentle attention pulse the moment it first appears in a turn. */
#tryvue-chat-root .tvc-composer__attach.is-pulsing {
	border-color: var(--tvc-accent);
	color: var(--tvc-accent);
	animation: tvc-attach-pulse 1.8s ease-in-out infinite;
}
@keyframes tvc-attach-pulse {
	0%, 100% { box-shadow: 0 0 0 0 var(--tvc-accent-ring); }
	50% { box-shadow: 0 0 0 5px transparent; }
}


#tryvue-chat-root .tvc-composer__input {
	flex: 1;
	min-width: 0;
	height: 44px;            /* one-line baseline; JS grows it up to max-height */
	min-height: 44px;
	max-height: 120px;
	resize: none;
	padding: 11px 14px;
	border: 1px solid var(--tvc-border);
	border-radius: 14px;
	background: var(--tvc-surface-2);
	color: var(--tvc-text);
	font-family: inherit;
	font-size: 14.5px;
	line-height: 1.4;
	overflow-y: auto;
	transition: border-color .15s, box-shadow .15s;
}
#tryvue-chat-root .tvc-composer__input::placeholder { color: var(--tvc-muted); }
#tryvue-chat-root .tvc-composer__input:focus {
	outline: none;
	border-color: var(--tvc-accent);
	box-shadow: 0 0 0 3px var(--tvc-accent-ring);
}
#tryvue-chat-root .tvc-composer__send {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 12px;
	background: var(--tvc-accent-grad);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 12px var(--tvc-accent-glow);
	transition: filter .15s, transform .1s, opacity .15s;
}
#tryvue-chat-root .tvc-composer__send:hover { filter: brightness(1.06); }
#tryvue-chat-root .tvc-composer__send:active { transform: translateY(1px); }
#tryvue-chat-root .tvc-composer__send:disabled { opacity: .5; cursor: not-allowed; }

/* ── Access-mode: sign-in gate / invite (audience gating) ──────────────
   Four owner-selectable modes drive these UI affordances (server re-enforces):
     - members_prompt guest  → a full GATE replaces the composer (.tvc-authgate
       inside a .tvc-composer--gated footer) — read the greeting, must sign in.
     - everyone_prompt guest → a gentle INVITE banner (.tvc-authinvite) sits
       above a fully working composer — an upsell, never a block.
     - 401 login_required     → an INLINE gate (.tvc-authgate--inline) is
       appended to the transcript as an assistant row.
   All are accent-driven and theme-aware via the same tokens used elsewhere. */

/* Gated composer footer — hosts the sign-in gate instead of the input row. */
#tryvue-chat-root .tvc-composer--gated {
	display: block;
	padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

/* Full sign-in gate (replaces the composer for members_prompt guests). */
#tryvue-chat-root .tvc-authgate {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	text-align: center;
	padding: 16px 16px 18px;
	border: 1px solid var(--tvc-border);
	border-radius: var(--tvc-radius-sm);
	background: var(--tvc-surface-2);
}
#tryvue-chat-root .tvc-authgate__text {
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--tvc-text-soft);
}
#tryvue-chat-root .tvc-authgate__actions {
	display: flex;
	gap: 9px;
	flex-wrap: wrap;
	justify-content: center;
	width: 100%;
}

/* Inline variant — appended to the transcript on a server 401 login_required.
   Reads as an assistant message, so it drops the surrounding card chrome. */
#tryvue-chat-root .tvc-authgate--inline {
	padding: 0;
	border: none;
	background: transparent;
	align-items: flex-start;
	text-align: left;
}
#tryvue-chat-root .tvc-authgate--inline .tvc-authgate__actions { justify-content: flex-start; }

/* Gentle sign-in invitation ABOVE a working composer (everyone_prompt guest). */
#tryvue-chat-root .tvc-authinvite {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 10px 14px;
	background: var(--tvc-surface-2);
	border-top: 1px solid var(--tvc-border-soft);
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-authinvite__text {
	flex: 1;
	min-width: 140px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--tvc-text-soft);
}
#tryvue-chat-root .tvc-authinvite__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

/* Compact auth action buttons (reuse .tvc-btn look, tighter for these rows). */
#tryvue-chat-root .tvc-authbtn { padding: 8px 16px; font-size: 12.5px; }
#tryvue-chat-root .tvc-authinvite .tvc-authbtn { padding: 6px 12px; font-size: 12px; }

/* ── Powered by ────────────────────────────────────────────────────────── */

#tryvue-chat-root .tvc-poweredby {
	text-align: center;
	padding: 0 0 9px;
	background: var(--tvc-surface);
	flex-shrink: 0;
}
#tryvue-chat-root .tvc-poweredby a {
	font-size: 10.5px;
	font-weight: 600;
	color: var(--tvc-muted);
	text-decoration: none;
	letter-spacing: .02em;
}
#tryvue-chat-root .tvc-poweredby a:hover { color: var(--tvc-accent); }

/* ── Responsive: tablets / small laptops ───────────────────────────────── */
@media (max-width: 640px) and (min-width: 481px) {
	#tryvue-chat-root {
		--tvc-panel-w: min(400px, calc(100vw - 32px));
		--tvc-panel-h: min(600px, calc(100vh - 32px));
	}
}

/* ── Responsive: phones - full-height bottom-sheet ─────────────────────── */

@media (max-width: 480px) {
	#tryvue-chat-root {
		right: 14px;
		bottom: 14px;
		/* keep clear of iOS home indicator when the launcher is visible */
		bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}
	#tryvue-chat-root .tvc-launcher {
		width: 56px;
		height: 56px;
		padding: 0;
		justify-content: center;
	}
	#tryvue-chat-root .tvc-launcher__label { display: none; }

	/* Panel becomes a full-screen sheet anchored to all edges — never overflows. */
	#tryvue-chat-root.is-open {
		right: 0;
		bottom: 0;
		left: 0;
		top: 0;
	}
	#tryvue-chat-root .tvc-panel {
		position: fixed;
		inset: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: 100dvh;
		border: none;
		border-radius: 0;
		transform-origin: center bottom;
	}
	#tryvue-chat-root .tvc-header {
		padding-top: calc(14px + env(safe-area-inset-top, 0px));
	}
	#tryvue-chat-root .tvc-composer {
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
	#tryvue-chat-root .tvc-bubble { max-width: 88%; }
	#tryvue-chat-root .tvc-products { max-width: 100%; }
	#tryvue-chat-root .tvc-composer__input { font-size: 16px; } /* avoid iOS zoom */
}

/* ── Position: LEFT corner ─────────────────────────────────────────────────
 * Owner-selectable widget position (Assistant → Widget → Position). Default is
 * bottom-right; [data-position="left"] mirrors the launcher + panel to the
 * bottom-LEFT corner. The mobile full-screen sheet is unaffected (it covers
 * the whole viewport either way).
 */
#tryvue-chat-root[data-position="left"] {
	right: auto;
	left: var(--tvc-edge);
}
#tryvue-chat-root[data-position="left"] .tvc-launcher {
	right: auto;
	left: 0;
}
#tryvue-chat-root[data-position="left"] .tvc-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

@media (max-width: 480px) {
	#tryvue-chat-root[data-position="left"] {
		right: auto;
		left: 14px;
	}
	/* Open sheet still spans the full viewport regardless of corner. */
	#tryvue-chat-root[data-position="left"].is-open {
		right: 0;
		left: 0;
	}
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	#tryvue-chat-root *,
	#tryvue-chat-root *::before,
	#tryvue-chat-root *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
	#tryvue-chat-root .tvc-dot { animation-duration: 1.3s !important; animation-iteration-count: infinite !important; }
}
