/**
 * Gemini Live Chat — widget styles.
 * Every colour and measurement comes from a custom property so the settings
 * screen can repaint the whole thing without touching this file.
 */

.glc-root,
.glc-root * {
	box-sizing: border-box;
}

.glc-root {
	position: fixed;
	z-index: var(--glc-z, 999999);
	font-family: var(--glc-font);
	font-size: var(--glc-font-size, 15px);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ---- Corners ---- */

.glc-pos-bottom-right { right: var(--glc-offset-x); bottom: var(--glc-offset-y); }
.glc-pos-bottom-left  { left:  var(--glc-offset-x); bottom: var(--glc-offset-y); }
.glc-pos-top-right    { right: var(--glc-offset-x); top:    var(--glc-offset-y); }
.glc-pos-top-left     { left:  var(--glc-offset-x); top:    var(--glc-offset-y); }

.glc-root {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
}

.glc-pos-bottom-left,
.glc-pos-top-left { align-items: flex-start; }

.glc-pos-top-right,
.glc-pos-top-left { flex-direction: column-reverse; }

/* ---- Launcher ---- */

.glc-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 22px;
	border: 0;
	margin: 0;
	background: var(--glc-launcher-bg);
	color: var(--glc-launcher-text);
	border-radius: var(--glc-launcher-radius);
	font: inherit;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	font-size: .85em;
	cursor: pointer;
	box-shadow: var(--glc-shadow);
	transition: transform .18s ease, filter .18s ease;
}

.glc-launcher:hover { transform: translateY(-2px); filter: brightness(1.05); }
.glc-launcher:focus-visible { outline: 3px solid var(--glc-launcher-text); outline-offset: 3px; }
.glc-launcher:active { transform: translateY(0); }

.glc-launcher-icon { display: inline-flex; }

.glc-launcher-circle {
	width: 60px;
	height: 60px;
	padding: 0;
	justify-content: center;
	border-radius: 50%;
}
.glc-launcher-circle .glc-launcher-label { display: none; }
.glc-launcher-circle .glc-launcher-icon svg { width: 26px; height: 26px; }

.glc-launcher-bar { border-radius: 0; }

/* Unread pip on the launcher */
.glc-launcher[data-unread="1"]::after {
	content: "";
	position: absolute;
	top: -3px;
	right: -3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #e11d48;
	box-shadow: 0 0 0 2px #fff;
}
.glc-launcher { position: relative; }

/* ---- Panel ---- */

.glc-panel {
	width: var(--glc-panel-width);
	max-width: calc(100vw - 24px);
	height: var(--glc-panel-height);
	max-height: calc(100vh - 48px);
	display: flex;
	flex-direction: column;
	background: var(--glc-panel-bg);
	border-radius: var(--glc-panel-radius);
	box-shadow: var(--glc-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(.98);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

.glc-root[data-open="1"] .glc-panel {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.glc-root[data-open="0"] .glc-panel {
	position: absolute;
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.glc-panel, .glc-launcher { transition: none; }
}

/* ---- Header ---- */

.glc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px;
	background: var(--glc-header-bg);
	color: var(--glc-header-text);
	flex: 0 0 auto;
}

.glc-header .glc-title {
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	font-size: 1.05em;
	flex: 1 1 auto;
}

.glc-header .glc-logo { max-height: 26px; width: auto; }

.glc-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--glc-header-text);
	flex: 0 0 auto;
}
.glc-dot[data-online="0"] { opacity: .35; }

.glc-header-btn {
	background: none;
	border: 0;
	color: inherit;
	padding: 4px;
	cursor: pointer;
	opacity: .75;
	line-height: 0;
}
.glc-header-btn:hover { opacity: 1; }

/* ---- Messages ---- */

.glc-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 18px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scrollbar-width: thin;
}

.glc-msg { display: flex; max-width: 84%; }
.glc-msg-bot, .glc-msg-agent { align-self: flex-start; }
.glc-msg-user { align-self: flex-end; }

.glc-bubble {
	position: relative;
	padding: 12px 15px;
	border-radius: var(--glc-bubble-radius);
	background: var(--glc-bot-bg);
	color: var(--glc-bot-text);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.glc-msg-user .glc-bubble {
	background: var(--glc-user-bg);
	color: var(--glc-user-text);
	text-align: right;
}

/* Speech tails, as in the reference design */
.glc-bubble::after {
	content: "";
	position: absolute;
	bottom: -9px;
	width: 0;
	height: 0;
	border-style: solid;
}
.glc-msg-bot .glc-bubble::after,
.glc-msg-agent .glc-bubble::after {
	left: 14px;
	border-width: 10px 12px 0 0;
	border-color: var(--glc-bot-bg) transparent transparent transparent;
}
.glc-msg-user .glc-bubble::after {
	right: 14px;
	border-width: 0 12px 10px 0;
	border-color: transparent var(--glc-user-bg) transparent transparent;
	bottom: -9px;
	transform: scaleY(-1);
}

.glc-bubble p { margin: 0 0 .6em; }
.glc-bubble p:last-child { margin-bottom: 0; }
.glc-bubble ul { margin: .4em 0; padding-left: 1.1em; }
.glc-bubble li { margin: .2em 0; }
.glc-bubble a { color: inherit; text-decoration: underline; }
.glc-bubble code {
	background: rgba(0, 0, 0, .07);
	padding: 1px 5px;
	border-radius: 3px;
	font-size: .92em;
}

.glc-author {
	font-size: .72em;
	text-transform: uppercase;
	letter-spacing: .08em;
	opacity: .7;
	margin-bottom: 4px;
	display: block;
}

/* System notes */
.glc-msg-system {
	align-self: center;
	max-width: 92%;
}
.glc-msg-system .glc-bubble {
	background: rgba(0, 0, 0, .18);
	color: #fff;
	text-align: center;
	font-size: .9em;
	padding: 8px 14px;
	border-radius: 20px;
}
.glc-msg-system .glc-bubble::after { display: none; }

/* Sources */
.glc-sources {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(0, 0, 0, .1);
}
.glc-sources a {
	font-size: .8em;
	text-decoration: none;
	background: rgba(0, 0, 0, .06);
	padding: 4px 9px;
	border-radius: 20px;
	color: inherit;
}
.glc-sources a:hover { background: rgba(0, 0, 0, .12); }

/* Typing */
.glc-typing { display: flex; gap: 4px; padding: 4px 2px; }
.glc-typing span {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: .4;
	animation: glc-blink 1.2s infinite;
}
.glc-typing span:nth-child(2) { animation-delay: .2s; }
.glc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes glc-blink {
	0%, 60%, 100% { opacity: .25; transform: translateY(0); }
	30% { opacity: .9; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
	.glc-typing span { animation: none; }
}

/* ---- Chips, forms, actions ---- */

.glc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 16px 12px;
}
.glc-chip {
	background: rgba(255, 255, 255, .92);
	color: var(--glc-bot-text);
	border: 0;
	border-radius: 20px;
	padding: 8px 14px;
	font: inherit;
	font-size: .88em;
	cursor: pointer;
	transition: transform .12s ease;
}
.glc-chip:hover { transform: translateY(-1px); }

.glc-handoff-btn {
	align-self: flex-start;
	margin: 2px 0 6px;
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, .8);
	color: #fff;
	border-radius: 20px;
	padding: 8px 15px;
	font: inherit;
	font-size: .85em;
	cursor: pointer;
}
.glc-handoff-btn:hover { background: rgba(255, 255, 255, .16); }

.glc-form {
	background: var(--glc-bot-bg);
	color: var(--glc-bot-text);
	border-radius: var(--glc-bubble-radius);
	padding: 14px;
	margin: 4px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.glc-form input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 4px;
	font: inherit;
	background: #fff;
	color: inherit;
}
.glc-form-row { display: flex; gap: 8px; }
.glc-form button {
	flex: 1;
	padding: 10px;
	border: 0;
	border-radius: 4px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	background: var(--glc-accent);
	color: #fff;
}
.glc-form button.glc-skip { background: transparent; color: inherit; opacity: .7; }

/* ---- Composer ---- */

.glc-composer {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 16px 16px;
	background: var(--glc-input-bg);
	border-radius: var(--glc-bubble-radius);
	padding: 4px 6px 4px 14px;
}

.glc-composer input,
.glc-composer textarea {
	flex: 1 1 auto;
	border: 0;
	background: transparent;
	font: inherit;
	color: var(--glc-input-text);
	padding: 12px 0;
	resize: none;
	max-height: 96px;
	line-height: 1.4;
}
.glc-composer input:focus,
.glc-composer textarea:focus { outline: none; }
.glc-composer input::placeholder,
.glc-composer textarea::placeholder { color: var(--glc-input-text); opacity: .55; }

.glc-send {
	background: none;
	border: 0;
	cursor: pointer;
	padding: 8px 10px;
	color: var(--glc-input-text);
	line-height: 0;
	border-radius: 4px;
}
.glc-send:disabled { opacity: .35; cursor: default; }
.glc-send:hover:not(:disabled) { background: rgba(0, 0, 0, .07); }

.glc-consent {
	margin: -8px 16px 12px;
	font-size: .74em;
	color: #fff;
	opacity: .8;
	text-align: center;
}

.glc-error {
	margin: 0 16px 8px;
	font-size: .82em;
	background: rgba(0, 0, 0, .25);
	color: #fff;
	padding: 8px 12px;
	border-radius: 4px;
}

/* ---- Feedback ---- */

.glc-rate {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	padding: 0 16px 10px;
	font-size: .82em;
	color: #fff;
}
.glc-rate button {
	background: rgba(255, 255, 255, .2);
	border: 0;
	color: #fff;
	border-radius: 4px;
	padding: 5px 10px;
	cursor: pointer;
	font: inherit;
}
.glc-rate button:hover { background: rgba(255, 255, 255, .35); }

/* ---- Inline mode (shortcode) ---- */

.glc-inline {
	position: relative;
	inset: auto;
	width: 100%;
	display: block;
}
.glc-inline .glc-panel {
	opacity: 1;
	transform: none;
	pointer-events: auto;
	position: relative;
	visibility: visible;
	width: 100%;
	height: 100%;
	max-height: none;
}
.glc-inline .glc-launcher { display: none; }

/* ---- Mobile ---- */

@media (max-width: 640px) {
	.glc-pos-bottom-right { right: var(--glc-mobile-x); bottom: var(--glc-mobile-y); }
	.glc-pos-bottom-left  { left:  var(--glc-mobile-x); bottom: var(--glc-mobile-y); }
	.glc-pos-top-right    { right: var(--glc-mobile-x); top:    var(--glc-mobile-y); }
	.glc-pos-top-left     { left:  var(--glc-mobile-x); top:    var(--glc-mobile-y); }

	.glc-root[data-open="1"] .glc-panel {
		position: fixed;
		inset: 0;
		width: 100vw;
		height: 100dvh;
		max-width: none;
		max-height: none;
		border-radius: 0;
	}
	.glc-root[data-open="1"] .glc-launcher { display: none; }
	.glc-root[data-mobile-hidden="1"] { display: none; }
}


/* ---- Language switcher ---- */

.glc-lang-switch {
	background: rgba(255, 255, 255, .12);
	color: inherit;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 4px;
	font: inherit;
	font-size: .78em;
	padding: 3px 6px;
	cursor: pointer;
	max-width: 120px;
}
.glc-lang-switch:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.glc-lang-switch option { color: #222; background: #fff; }

/* ---- Right to left ---- */

.glc-panel[dir="rtl"] { text-align: right; }
.glc-panel[dir="rtl"] .glc-composer { padding: 4px 14px 4px 6px; }
.glc-panel[dir="rtl"] .glc-bubble ul { padding-left: 0; padding-right: 1.1em; }
.glc-panel[dir="rtl"] .glc-msg-user .glc-bubble { text-align: left; }

/* The tails swap sides with the text. */
.glc-panel[dir="rtl"] .glc-msg-bot .glc-bubble::after,
.glc-panel[dir="rtl"] .glc-msg-agent .glc-bubble::after {
	left: auto;
	right: 14px;
	border-width: 10px 0 0 12px;
	border-color: var(--glc-bot-bg) transparent transparent transparent;
}
.glc-panel[dir="rtl"] .glc-msg-user .glc-bubble::after {
	right: auto;
	left: 14px;
	border-width: 0 0 10px 12px;
	border-color: transparent transparent var(--glc-user-bg) transparent;
	transform: none;
}
.glc-panel[dir="rtl"] .glc-send svg { transform: scaleX(-1); }
.glc-panel[dir="rtl"] .glc-handoff-btn { align-self: flex-end; }


/* =========================================================================
   Theme armour.
   Themes style bare `button`, `input` and `textarea` elements, and those
   rules land after this file. Everything below is scoped under .glc-root so
   it outranks them on specificity rather than shouting with !important.
   ====================================================================== */

.glc-root button,
.glc-root input,
.glc-root textarea,
.glc-root select,
.glc-root a {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	text-decoration: none;
	box-shadow: none;
	min-height: 0;
	min-width: 0;
	max-width: none;
	width: auto;
	height: auto;
	margin: 0;
	filter: none;
	float: none;
	position: static;
	transition: none;
}

.glc-root button {
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* Suggested question chips */
.glc-root .glc-chip {
	display: inline-block;
	background: var(--glc-chip-bg);
	color: var(--glc-chip-text);
	border: var(--glc-chip-border-width) solid var(--glc-chip-border);
	border-radius: var(--glc-chip-radius);
	padding: 8px 14px;
	font-size: .88em;
	font-weight: 400;
	text-align: left;
	line-height: 1.35;
	transition: transform .12s ease, filter .12s ease;
}
.glc-root .glc-chip:hover {
	transform: translateY(-1px);
	filter: brightness(.96);
}
.glc-root .glc-chip:focus-visible {
	outline: 2px solid var(--glc-chip-text);
	outline-offset: 2px;
}

/* Talk-to-a-person button */
.glc-root .glc-handoff-btn {
	background: transparent;
	color: var(--glc-handoff-text);
	border: 1.5px solid var(--glc-handoff-text);
	border-radius: var(--glc-chip-radius);
	padding: 8px 15px;
	font-size: .85em;
	transition: background .15s ease;
}
.glc-root .glc-handoff-btn:hover {
	background: rgba(255, 255, 255, .16);
}

/* Launcher, composer and send button */
.glc-root .glc-launcher {
	background: var(--glc-launcher-bg);
	color: var(--glc-launcher-text);
	border: 0;
	border-radius: var(--glc-launcher-radius);
	padding: 13px 22px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	font-size: .85em;
	box-shadow: var(--glc-shadow);
	transition: transform .18s ease, filter .18s ease;
}
.glc-root .glc-launcher-circle { padding: 0; width: 60px; height: 60px; }

.glc-root .glc-composer input,
.glc-root .glc-composer textarea {
	width: 100%;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--glc-input-text);
	padding: 12px 0;
	box-shadow: none;
}
.glc-root .glc-send {
	background: none;
	border: 0;
	padding: 8px 10px;
	color: var(--glc-input-text);
	border-radius: 4px;
	width: auto;
}

.glc-root .glc-form input {
	width: 100%;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 4px;
	padding: 10px 12px;
	color: inherit;
}
.glc-root .glc-form button {
	background: var(--glc-accent);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 10px;
	font-weight: 600;
	flex: 1;
}
.glc-root .glc-form button.glc-skip {
	background: transparent;
	color: inherit;
	opacity: .7;
}

.glc-root .glc-bubble a {
	color: inherit;
	text-decoration: underline;
}


/* Always-available "talk to a person" in the header */
.glc-root .glc-header-handoff {
	background: transparent;
	color: inherit;
	border: 1px solid currentColor;
	border-radius: 20px;
	padding: 4px 11px;
	font-size: .72em;
	font-weight: 600;
	letter-spacing: .02em;
	opacity: .85;
	white-space: nowrap;
	transition: opacity .15s ease;
}
.glc-root .glc-header-handoff:hover { opacity: 1; }


/* =========================================================================
   Chat button and close button, driven by their own settings.
   ====================================================================== */

.glc-root .glc-launcher {
	font-family: var(--glc-launcher-font);
	font-size: var(--glc-launcher-size);
	font-weight: var(--glc-launcher-weight);
	text-transform: var(--glc-launcher-case);
	letter-spacing: var(--glc-launcher-tracking);
	background: var(--glc-launcher-bg);
	color: var(--glc-launcher-text);
}

.glc-root .glc-launcher:hover,
.glc-root .glc-launcher:focus-visible {
	background: var(--glc-launcher-hover-bg);
	color: var(--glc-launcher-hover-text);
	filter: var(--glc-launcher-hover-filter);
	transform: translateY(-2px);
}

.glc-root .glc-launcher:active { transform: translateY(0); }

.glc-root .glc-launcher-icon,
.glc-root .glc-launcher-icon svg,
.glc-root .glc-launcher-icon img {
	width: var(--glc-icon-size);
	height: var(--glc-icon-size);
	display: block;
	flex: 0 0 auto;
}

.glc-root .glc-launcher-circle .glc-launcher-icon,
.glc-root .glc-launcher-circle .glc-launcher-icon svg,
.glc-root .glc-launcher-circle .glc-launcher-icon img {
	width: calc(var(--glc-icon-size) * 1.3);
	height: calc(var(--glc-icon-size) * 1.3);
}

/* No icon, or an icon on the right: keep the label centred sensibly. */
.glc-root .glc-launcher-label:only-child { margin: 0 auto; }

/* Close button */
.glc-root .glc-header-btn {
	background: none;
	border: 0;
	padding: 4px;
	line-height: 0;
	color: var(--glc-close);
	opacity: .8;
	border-radius: 4px;
	transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.glc-root .glc-header-btn:hover,
.glc-root .glc-header-btn:focus-visible {
	color: var(--glc-close-hover);
	opacity: 1;
	background: rgba(127, 127, 127, .18);
}
.glc-root .glc-header-btn svg { display: block; }


/* =========================================================================
   Launcher layout.

   Some themes set `display: block` on every button, which pushes the icon
   onto its own line and drops the label underneath it. Colour and spacing
   stay in normal rules above; only these structural properties are forced,
   because a theme winning here breaks the button outright.
   ====================================================================== */

.glc-root .glc-launcher {
	display: inline-flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	white-space: nowrap !important;
	gap: var(--glc-launcher-gap);
	padding: var(--glc-launcher-pad-y) var(--glc-launcher-pad-x);
	width: var(--glc-launcher-width);
	min-width: var(--glc-launcher-min-width);
	max-width: calc(100vw - 32px);
	box-sizing: border-box;
	text-align: center;
}

.glc-root .glc-launcher-label {
	display: inline !important;
	white-space: nowrap !important;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

.glc-root .glc-launcher-icon {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

/* The circle style ignores the width settings by design. */
.glc-root .glc-launcher-circle {
	width: calc(var(--glc-icon-size) * 3) !important;
	height: calc(var(--glc-icon-size) * 3) !important;
	min-width: 0;
	padding: 0 !important;
	border-radius: 50%;
}
.glc-root .glc-launcher-circle .glc-launcher-label { display: none !important; }
