/*
 * Qatar Chamber Chatbot widget — styles.
 * Ported verbatim from Figma-Designs/qc-chatbot/index.html. Injected site-wide
 * as a company-scoped globalCSS Client Extension; the DOM is built by
 * qc-chatbot.js and appended to <body>, so these rules are self-contained and
 * namespaced under .qc-chatbot-* to avoid colliding with page/fragment CSS.
 */
.qc-chatbot {
	--qc-cb-maroon: #8A1538;
	--qc-cb-maroon-dark: #6D1028;
	--qc-cb-maroon-light: #A32B46;
	--qc-cb-bubble-bot: #F2F2F2;
	--qc-cb-text: #3F3F3F;
	--qc-cb-radius: 12px;
	--qc-cb-font: "Cairo", "Segoe UI", "Noto Kufi Arabic", "Helvetica Neue", Tahoma, Arial, sans-serif;

	position: fixed;
	inset-inline-end: 24px;
	bottom: 75px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	font-family: var(--qc-cb-font);
	/* This element is only a positioning box, and a CLOSED panel still occupies
	   its layout slot (visibility:hidden keeps the box; display:none would not).
	   That makes the container ~390x645 of invisible, click-swallowing surface,
	   which reaches up into the header on any viewport shorter than ~730px and
	   silently kills the right-hand nav links. Let clicks pass through it and
	   re-enable them only on the parts that are actually interactive. */
	pointer-events: none;
}

.qc-chatbot .qc-launcher-wrap,
.qc-chatbot.is-open .qc-panel {
	pointer-events: auto;
}

.qc-chatbot *,
.qc-chatbot *::before,
.qc-chatbot *::after {
	box-sizing: border-box;
}

/* ---------- Panel ---------- */
.qc-chatbot .qc-panel {
	width: 390px;
	/* The panel is anchored to the bottom, so a FIXED height clips its header
	   off the top of the viewport on any short window — landscape phones
	   (844x390) and short desktop windows both lost the logo/minimise row.
	   Cap it against the viewport instead: 120px reserves the launcher (66),
	   the flex gap (14), the bottom offset (24) and a small top margin.
	   The plain-vh line is the fallback for engines without dvh; dvh is what
	   tracks mobile browser chrome collapsing in/out. */
	height: 577px;
	height: min(577px, calc(100vh - 120px));
	height: min(577px, calc(100dvh - 120px));
	background: #fff;
	border: 1px solid #D0D0D0;
	border-radius: var(--qc-cb-radius);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.qc-chatbot[dir="rtl"] .qc-panel {
	transform-origin: bottom left;
}

.qc-chatbot:not(.is-open) .qc-panel {
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.96);
	pointer-events: none;
}

/* ---------- Header ---------- */
.qc-chatbot .qc-header {
	flex: 0 0 auto;
	height: 64px;
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(270deg, var(--Gray-Gray-700, #4A4A49) 0%, var(--Primary-500-primary, #911731) 100%);
}

.qc-chatbot .qc-header-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.qc-chatbot .qc-header-logo {
	height: 34px;
	object-fit: contain;
}

.qc-chatbot .qc-minimize {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	opacity: .9;
	transition: background .15s ease, opacity .15s ease;
}

.qc-chatbot .qc-minimize:hover {
	background: rgba(255, 255, 255, .15);
	opacity: 1;
}

.qc-chatbot .qc-minimize svg {
	width: 16px;
	height: 16px;
}

/* ---------- Messages ---------- */
/* Bottom-anchored transcript: a short conversation (the opening welcome message
   on its own) sits just above the composer and grows UPWARD, instead of hanging
   from the top of an otherwise empty panel.

   The push-down is an auto block-start margin on a ::before spacer, NOT
   `justify-content: flex-end` — flex-end in a scroll container makes the
   overflowing TOP unreachable once the transcript is taller than the panel,
   while an auto margin collapses to 0 in that same case and scrolls normally.
   Every child is pinned `flex: 0 0 auto` because a flex column with a fixed
   height otherwise shrinks/mis-measures tall children, which is what made this
   a plain block container before. Each .qc-msg is still flex-row internally for
   avatar + bubble, and qc-chatbot.js keeps the newest message in view via
   scrollTop = scrollHeight. */
.qc-chatbot .qc-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 22px 18px 8px;
	display: flex;
	flex-direction: column;
}

.qc-chatbot .qc-body::before {
	content: "";
	margin-block-start: auto;
}

.qc-chatbot .qc-body > * {
	flex: 0 0 auto;
}

.qc-chatbot .qc-body::-webkit-scrollbar {
	width: 6px;
}

.qc-chatbot .qc-body::-webkit-scrollbar-thumb {
	background: #d8d8d8;
	border-radius: 3px;
}

.qc-chatbot .qc-msg {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	max-width: 100%;
	margin-bottom: 16px;
}

.qc-chatbot .qc-msg:last-child {
	margin-bottom: 0;
}

.qc-chatbot .qc-msg-bot {
	justify-content: flex-start;
}

.qc-chatbot .qc-msg-user {
	justify-content: flex-end;
}

.qc-chatbot .qc-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #E4E4E4;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin-top: 2px;
}

.qc-chatbot .qc-avatar img {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.qc-chatbot .qc-bubble {
	max-width: 78%;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.55;
	border-radius: 10px;
	word-wrap: break-word;
	/* Dialogflow answers are multi-paragraph (blank lines, then a trailing
	   source line). The text is set with textContent, so without this the
	   whole answer collapses into one block. */
	white-space: pre-line;
}

.qc-chatbot .qc-msg-bot .qc-bubble {
	background: var(--qc-cb-bubble-bot);
	color: var(--qc-cb-text);
	border-top-left-radius: 0;
	
	[dir=rtl] & {
		border-top-left-radius: 10px;
		border-top-right-radius: 0;
	}
}

.qc-chatbot .qc-msg-user .qc-bubble {
	background: var(--qc-cb-maroon);
	color: #fff;
	font-weight: 400;
	border-top-right-radius: 0;

	[dir=rtl] & {
		border-top-right-radius: 10px;
		border-top-left-radius: 0;
	}
}

/* typing dots */
.qc-chatbot .qc-typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 16px;
}

.qc-chatbot .qc-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9a9a9a;
	animation: qc-cb-blink 1.2s infinite ease-in-out;
}

.qc-chatbot .qc-typing span:nth-child(2) {
	animation-delay: .18s;
}

.qc-chatbot .qc-typing span:nth-child(3) {
	animation-delay: .36s;
}

@keyframes qc-cb-blink {

	0%,
	80%,
	100% {
		opacity: .25;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* ---------- Composer ---------- */
/* Geometry from Figma "Send Chat" (849:14545): 16px inline padding, 12px gap
   between the pill and the send button. */
.qc-chatbot .qc-composer {
	flex: 0 0 auto;
	padding: 14px 16px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	position: relative;
}

/* "Type a message" validation tooltip, floating above the input pill. */
.qc-chatbot .qc-hint {
	position: absolute;
	inset-inline-start: 16px;
	bottom: calc(100% - 8px);
	max-width: calc(100% - 32px);
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--qc-cb-maroon);
	color: #fff;
	font-family: var(--qc-cb-font);
	font-size: 13px;
	line-height: 18px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
	pointer-events: none;
	z-index: 2;
}

.qc-chatbot .qc-hint[hidden] {
	display: none;
}

.qc-chatbot .qc-hint::after {
	content: '';
	position: absolute;
	inset-inline-start: 24px;
	top: 100%;
	border: 6px solid transparent;
	border-top-color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-input-wrap.is-invalid {
	border-color: var(--qc-cb-maroon);
}

/* The pill that holds the mic + the text field. The border/radius/padding live
   here (not on the <input>) because the mic sits INSIDE the pill in the
   design. */
.qc-chatbot .qc-input-wrap {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	background: #fff;
	border: 1px solid #DEDEDD;
	border-radius: 9999px;
	transition: border-color .15s ease;
}

.qc-chatbot .qc-input-wrap:focus-within {
	border-color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 22px;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: var(--qc-cb-font);
	font-size: 14px;
	line-height: 22px;
	color: var(--qc-cb-text);
	outline: none;

	&:focus, &:focus-visible {
		outline: none !important;
	}

	[dir=rtl] & {
		direction: rtl;
	}
}

.qc-chatbot .qc-input::placeholder {
	color: #D0D0D0;
}

.qc-chatbot .qc-send {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: 0;
	border-radius: 50%;
	background: var(--qc-cb-maroon);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, transform .15s ease;
}

.qc-chatbot .qc-send:hover {
	background: var(--qc-cb-maroon-dark);
}

.qc-chatbot .qc-send:active {
	transform: scale(.94);
}

/* paper plane must point the way the text flows */
.qc-chatbot[dir="rtl"] .qc-send svg {
	transform: scaleX(-1);
}

/* ---------- System note (context reset) ---------- */
.qc-chatbot .qc-note {
	margin: 0 0 16px;
	padding: 0 8px;
	font-size: 12px;
	line-height: 1.5;
	color: #8A8A8A;
	text-align: center;
}

/* ---------- Rich text inside a bot answer ---------- */
/* The agent replies in markdown; qc-chatbot.js turns the subset it uses into
   real elements. Margins are collapsed at the bubble edges so a single
   paragraph looks identical to the old plain-text bubble. */
.qc-chatbot .qc-bubble p,
.qc-chatbot .qc-bubble ul,
.qc-chatbot .qc-bubble ol {
	margin: 0 0 10px;
}

.qc-chatbot .qc-bubble > :last-child {
	margin-bottom: 0;
}

.qc-chatbot .qc-bubble ul,
.qc-chatbot .qc-bubble ol {
	padding-inline-start: 20px;
}

.qc-chatbot .qc-bubble li {
	margin-bottom: 5px;
}

.qc-chatbot .qc-bubble li:last-child {
	margin-bottom: 0;
}

.qc-chatbot .qc-bubble strong {
	font-weight: 700;
}

.qc-chatbot .qc-link {
	color: var(--qc-cb-maroon);
	text-decoration: underline;
	word-break: break-word;
}

.qc-chatbot .qc-link:hover {
	color: var(--qc-cb-maroon-dark);
}

/* ---------- Quick-reply buttons ---------- */
/* Own row under the bot bubble, indented past the 28px avatar + 9px gap so the
   chips line up with the bubble's text edge. */
.qc-chatbot .qc-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	padding-inline-start: 37px;
}

.qc-chatbot .qc-quick-replies:last-child {
	margin-bottom: 0;
}

/* The chips belong to the answer above them, not to the next turn. */
.qc-chatbot .qc-msg + .qc-quick-replies {
	margin-top: -8px;
}

/* The retry action belongs to the centred note above it, not to a bot bubble,
   so it drops the avatar indent the answer chips are aligned to (bug 137487).
   Logical properties, so RTL mirrors without a second rule. */
.qc-chatbot .qc-retry {
	justify-content: center;
	margin-top: -8px;
	padding-inline-start: 0;
}

.qc-chatbot .qc-chip {
	max-width: 100%;
	padding: 9px 16px;
	border: 1px solid var(--qc-cb-maroon);
	border-radius: 18px;
	background: #fff;
	color: var(--qc-cb-maroon);
	font-family: var(--qc-cb-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .15s ease,
		opacity .15s ease;
}

.qc-chatbot .qc-chip:hover:not(:disabled) {
	background: var(--qc-cb-maroon);
	color: #fff;
}

.qc-chatbot .qc-chip:active:not(:disabled) {
	transform: scale(.97);
}

/* Spent row: kept on screen as the record of what was offered, but visibly
   out of play. The chosen chip stays filled so the transcript reads back. */
.qc-chatbot .qc-quick-replies.is-spent .qc-chip {
	cursor: default;
	opacity: .45;
}

.qc-chatbot .qc-quick-replies.is-spent .qc-chip.is-chosen {
	background: var(--qc-cb-maroon);
	color: #fff;
	opacity: 1;
}

/* ---------- Mic (voice input) ---------- */
/* Figma draws the mic as a bare 15.4px glyph inside the input pill, so the
   button is exactly the glyph - no disc, no border. The tap target is grown
   back to a comfortable size with a transparent ::after that does not affect
   layout (the inline overhang stops inside the 8px gap, so it never eats
   clicks meant for the text field). */
.qc-chatbot .qc-mic {
	position: relative;
	width: 15.4px;
	height: 15.4px;
	flex: 0 0 auto;
	border: 0;
	background: none;
	color: #A8A8A7;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: color .15s ease, transform .15s ease;
}

/* Drawn hidden; shown once the Chatbot Configuration says voice input is on
   (the display above would otherwise beat the [hidden] attribute). */
.qc-chatbot .qc-mic[hidden] {
	display: none;
}

.qc-chatbot .qc-mic::after {
	content: "";
	position: absolute;
	inset-block: -10px;
	inset-inline: -8px;
}

.qc-chatbot .qc-mic svg {
	width: 15.4px;
	height: 15.4px;
	transition: opacity .15s ease, transform .15s ease;
}

.qc-chatbot .qc-mic:hover:not(:disabled) {
	color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-mic:active:not(:disabled) {
	transform: scale(.9);
}

.qc-chatbot .qc-mic:disabled {
	opacity: .5;
	cursor: default;
}

/* Recording: the glyph is replaced by a filled maroon stop square, with a slow
   halo so it is obvious the mic is live even at a glance. */
.qc-chatbot .qc-mic.is-recording {
	color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-mic.is-recording svg {
	opacity: 0;
	transform: scale(.6);
}

.qc-chatbot .qc-mic-stop {
	position: absolute;
	width: 11px;
	height: 11px;
	border-radius: 2px;
	background: var(--qc-cb-maroon);
	opacity: 0;
	transform: scale(.6);
	transition: opacity .15s ease, transform .15s ease;
}

.qc-chatbot .qc-mic.is-recording .qc-mic-stop {
	opacity: 1;
	transform: scale(1);
}

.qc-chatbot .qc-mic.is-recording::before {
	content: "";
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	border: 2px solid var(--qc-cb-maroon);
	animation: qc-cb-pulse 1.4s infinite ease-out;
}

@keyframes qc-cb-pulse {

	0% {
		opacity: .55;
		transform: scale(.85);
	}

	100% {
		opacity: 0;
		transform: scale(1.25);
	}
}

/* The halo is decoration, not information - the filled stop square and the
   placeholder text already say "recording". */
@media (prefers-reduced-motion: reduce) {
	.qc-chatbot .qc-mic.is-recording::before {
		animation: none;
		opacity: .4;
	}

	.qc-chatbot .qc-launcher-wrap {
		transition: none;
	}
}

/* Disabled while a recording is live. The pill owns the background now, so the
   field itself only dims its text. */
.qc-chatbot .qc-input:disabled {
	background: transparent;
	color: #8A8A8A;
}

/* ---------- Voice message bubble ---------- */
.qc-chatbot .qc-msg-voice .qc-bubble {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 82%;
	padding: 10px 12px;
}

.qc-chatbot .qc-voice-player {
	width: 220px;
	max-width: 100%;
	height: 34px;
	display: block;
}

.qc-chatbot .qc-voice-transcript,
.qc-chatbot .qc-voice-label {
	font-size: 13px;
	line-height: 1.5;
}

.qc-chatbot .qc-voice-label {
	font-weight: 400;
	opacity: .85;
}

/* ---------- Launcher ---------- */
.qc-chatbot .qc-launcher-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	/* qc-chatbot.js lifts the launcher above the footer's last row (ADO
	   151159); ease it rather than jump. */
	transition: transform .2s ease;
}

.qc-chatbot .qc-tooltip {
	position: relative;
	background: var(--qc-cb-maroon);
	color: #fff;
	font-size: 14px;
	padding: 11px 18px;
	border-radius: 10px;
	white-space: nowrap;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
	transition: opacity .2s ease, transform .2s ease;
}

.qc-chatbot .qc-tooltip::after {
	content: "";
	position: absolute;
	inset-inline-end: -6px;
	bottom: 12px;
	width: 14px;
	height: 14px;
	background: var(--qc-cb-maroon);
	transform: rotate(45deg);
	border-radius: 2px;
}

.qc-chatbot.is-open .qc-tooltip {
	opacity: 0;
	transform: translateX(10px);
	pointer-events: none;
}

.qc-chatbot[dir="rtl"].is-open .qc-tooltip {
	transform: translateX(-10px);
}

/* The tooltip is a hover affordance on the Help icon, not permanent chrome:
   hidden until the visitor points at (or keyboard-focuses) the launcher,
   visible for as long as the pointer stays on the icon OR on the tooltip
   itself - both live in .qc-launcher-wrap, so crossing the 12px gap between
   them never flickers it - and gone again the moment the pointer leaves.

   `visibility` (not `display`) keeps the tooltip's box in the flex row while
   hidden, so the launcher never jumps sideways when the tooltip appears; it
   is delayed out by the fade duration so the fade-out is still visible, and
   switched instantly on the way in.

   Gated behind `hover: hover`/`pointer: fine`: a touch device has no pointer
   to hover with, and :hover there STICKS after a tap until the next tap
   elsewhere (see qc-responsive-rtl-css-checklist), so coarse pointers keep
   the previous always-visible tooltip instead of a state they cannot drive. */
@media (hover: hover) and (pointer: fine) {
	.qc-chatbot .qc-tooltip {
		opacity: 0;
		pointer-events: none;
		transform: translateX(10px);
		transition: opacity .2s ease, transform .2s ease,
			visibility 0s linear .2s;
		visibility: hidden;
		display: none;
	}

	.qc-chatbot[dir="rtl"] .qc-tooltip {
		transform: translateX(-10px);
	}

	.qc-chatbot:not(.is-open) .qc-launcher-wrap:hover .qc-tooltip,
	.qc-chatbot:not(.is-open) .qc-launcher-wrap:focus-within .qc-tooltip {
		opacity: 1;
		pointer-events: auto;
		transform: none;
		transition: opacity .2s ease, transform .2s ease, visibility 0s;
		visibility: visible;
		display: block;
	}
}

/* Mobile / touch: hidden outright. The hover block above only ever REVEALS the
   tooltip on `hover: hover` + `pointer: fine`, so a coarse pointer fell through
   to the base rule and kept it permanently on screen next to the launcher. It
   is a hover affordance for a control that is already labelled (`aria-label` on
   the launcher), so on a device that cannot hover it is noise covering content.
   `display: none` rather than opacity/visibility: the box must leave the flex
   row entirely; nothing shifts when it goes because the launcher is already
   inline-end aligned (`align-items: flex-end` on the container, `align-self`
   on the wrap under 480px). `!important` because a narrow window on a
   hover-capable desktop matches BOTH this query and the reveal rule above,
   whose selector is the more specific of the two.

   The width bound is 1024px, not the 480px mobile breakpoint used elsewhere in
   this file: tablets and small laptops are wide enough to miss `max-width:480`
   yet still too narrow to spare the horizontal room the tooltip takes. */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
	.qc-chatbot .qc-tooltip {
		display: none !important;
	}
}

.qc-chatbot .qc-launcher {
	position: relative;
	width: 64px;
	height: 64px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background .22s ease, transform .22s ease, box-shadow .22s ease;
}

.qc-chatbot .qc-launcher:hover {
	transform: scale(1.05);
}

.qc-chatbot .qc-launcher img {
	width: 38px;
	height: 38px;
	object-fit: contain;
	transition: opacity .18s ease, transform .18s ease;
}

.qc-chatbot .qc-launcher .qc-close-icon {
	position: absolute;
	width: 22px;
	height: 22px;
	color: #fff;
	opacity: 0;
	transform: rotate(-90deg);
	transition: opacity .18s ease, transform .22s ease;
}

.qc-chatbot.is-open .qc-launcher {
	width: 64px;
	height: 64px;
	background: var(--qc-cb-maroon);
}

.qc-chatbot.is-open .qc-launcher img {
	opacity: 0;
	transform: scale(.6);
}

.qc-chatbot.is-open .qc-launcher .qc-close-icon {
	opacity: 1;
	transform: rotate(0deg);
}

/* ---------- Mobile ---------- */
@media (max-width:480px) {
	.qc-chatbot {
		inset-inline: 12px;
		bottom: 12px;
		align-items: stretch;
	}

	.qc-chatbot .qc-panel {
		width: auto;
		/* Height is governed by the viewport-capped rule on the base
		   .qc-panel selector — no override here, so there is one source of
		   truth and short-viewport clipping can't come back at this width. */
	}

	.qc-chatbot .qc-launcher-wrap {
		align-self: flex-end;
	}

	/* ADO 151159: at this width the launcher sits 12px off the bottom edge,
	   right over the footer's last row (legal links + copyright), and the page
	   could not scroll far enough to uncover them. Lifting it instead (as
	   qc-chatbot.js does on wider screens) lands it on Back to top and then the
	   social icons - the stacked mobile footer has no free gap. So reserve the
	   launcher's slot under the footer instead: 12 + 64 + 12 = 88px. Keyed on
	   the widget being present, so nothing changes where the chatbot is off. */
	body:has(> .qc-chatbot) .qc-global-site-footer .qc-footer-inner {
		padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Dark mode ---------- */
/* The accessibility panel stamps data-theme="dark" on <html> (qc-accessibility.js,
   pre-painted by qc-head-hooks.js). This widget paints with literal colors rather
   than the --qc-* tokens, so it does NOT flip on its own - without this block the
   conversation box stayed white on the dark page, and the typed text was set to
   the light-mode ink (#3F3F3F) inside an input that Chrome had already darkened
   from `color-scheme: dark`, i.e. dark text on a dark field.

   Values are the QC dark palette from qc-frontend/qc-global.css (Figma "Dark"
   variable mode): surface #1D1D1B, raised surface #343432, hairline #4A4A49,
   muted ink #A8A8A7, ink #FFFFFF. Maroon is brand-constant and stays. */
html[data-theme="dark"] .qc-chatbot {
	--qc-cb-bubble-bot: #343432;
	--qc-cb-text: #FFFFFF;

	color-scheme: dark;
}

html[data-theme="dark"] .qc-chatbot .qc-panel,
html[data-theme="dark"] .qc-chatbot .qc-composer {
	background: #1D1D1B;
}

html[data-theme="dark"] .qc-chatbot .qc-panel {
	border-color: #4A4A49;
}

html[data-theme="dark"] .qc-chatbot .qc-body::-webkit-scrollbar-thumb {
	background: #4A4A49;
}

html[data-theme="dark"] .qc-chatbot .qc-avatar {
	background: #343432;
	border-color: #4A4A49;
}

html[data-theme="dark"] .qc-chatbot .qc-input-wrap {
	background: #1D1D1B;
	border-color: #4A4A49;
}

html[data-theme="dark"] .qc-chatbot .qc-input-wrap:focus-within {
	border-color: #CD96A2;
}

/* The visible fix for "typed text disappears in dark mode". */
html[data-theme="dark"] .qc-chatbot .qc-input {
	color: #FFFFFF;
}

html[data-theme="dark"] .qc-chatbot .qc-input::placeholder {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-input:disabled {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-mic {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-mic:hover:not(:disabled) {
	color: #CD96A2;
}

/* On #1D1D1B the maroon stop square and halo are nearly invisible; the tint
   step (primary-200) is the dark-mode equivalent. */
html[data-theme="dark"] .qc-chatbot .qc-mic.is-recording,
html[data-theme="dark"] .qc-chatbot .qc-mic-stop {
	color: #CD96A2;
	background: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-mic.is-recording {
	background: none;
}

html[data-theme="dark"] .qc-chatbot .qc-mic.is-recording::before {
	border-color: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-note {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-link {
	color: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-link:hover {
	color: #E3BAC3;
}

/* Outlined chips: maroon-on-white is unreadable on the dark surface, so the
   outline/label move to the tint step. The filled hover/chosen states keep the
   brand maroon. */
html[data-theme="dark"] .qc-chatbot .qc-chip {
	background: #1D1D1B;
	border-color: #CD96A2;
	color: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-chip:hover:not(:disabled) {
	background: #911731;
	border-color: #911731;
	color: #FFFFFF;
}

/* ---------- Answer feedback (thumbs up / thumbs down) ---------- */
/* Its own row under the answer, indented past the avatar like the quick-reply
   chips, so the thumbs line up with the bubble's edge in LTR and RTL. */
.qc-chatbot .qc-feedback {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	margin: -10px 0 16px;
	padding-inline-start: 37px;
}

.qc-chatbot .qc-feedback:last-child {
	margin-bottom: 0;
}

.qc-chatbot .qc-feedback-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #8A8A8A;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.qc-chatbot .qc-feedback-btn svg {
	width: 17px;
	height: 17px;
}

/* One glyph for both: the downvote is the upvote turned over. */
.qc-chatbot .qc-feedback-down svg {
	transform: rotate(180deg) scaleX(-1);
}

.qc-chatbot .qc-feedback-btn:focus-visible {
	outline: 2px solid var(--qc-cb-maroon);
	outline-offset: 1px;
}

.qc-chatbot .qc-feedback-btn[aria-pressed="true"] {
	background: #F6E9EC;
	color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-feedback-btn[aria-pressed="true"] svg path {
	fill: currentColor;
	fill-opacity: .18;
}

.qc-chatbot .qc-feedback-status {
	padding-inline-start: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: #6F6F6F;
}

.qc-chatbot .qc-feedback-reason {
	margin: -8px 0 16px 37px;
	padding: 12px;
	border: 1px solid #E4E4E4;
	border-radius: 10px;
	background: #fff;
	font-size: 13px;
	color: var(--qc-cb-text);
}

.qc-chatbot[dir="rtl"] .qc-feedback-reason {
	margin-left: 0;
	margin-right: 37px;
}

.qc-chatbot .qc-feedback-reason:last-child {
	margin-bottom: 0;
}

.qc-chatbot .qc-feedback-prompt {
	margin-bottom: 8px;
	font-weight: 600;
}

.qc-chatbot .qc-feedback-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.qc-chatbot .qc-feedback-chip {
	padding: 5px 12px;
	font-size: 12px;
}

.qc-chatbot .qc-feedback-chip[aria-pressed="true"] {
	background: var(--qc-cb-maroon);
	color: #fff;
}

.qc-chatbot .qc-feedback-comment {
	box-sizing: border-box;
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #D6D6D6;
	border-radius: 8px;
	background: #fff;
	color: var(--qc-cb-text);
	font-family: var(--qc-cb-font);
	font-size: 13px;
	resize: vertical;
}

.qc-chatbot .qc-feedback-comment:focus {
	outline: none;
	border-color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-feedback-count {
	margin-top: 2px;
	font-size: 11px;
	color: #8A8A8A;
	text-align: end;
}

.qc-chatbot .qc-feedback-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 6px;
}

.qc-chatbot .qc-feedback-skip,
.qc-chatbot .qc-feedback-submit {
	padding: 6px 14px;
	border: 1px solid var(--qc-cb-maroon);
	border-radius: 16px;
	font-family: var(--qc-cb-font);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.qc-chatbot .qc-feedback-skip {
	background: #fff;
	color: var(--qc-cb-maroon);
}

.qc-chatbot .qc-feedback-submit {
	background: var(--qc-cb-maroon);
	color: #fff;
}

.qc-chatbot .qc-feedback-submit:disabled {
	opacity: .6;
	cursor: default;
}

.qc-chatbot .qc-feedback-notice {
	margin-top: 8px;
	font-size: 11px;
	line-height: 1.45;
	color: #8A8A8A;
}

@media (hover: hover) and (pointer: fine) {
	.qc-chatbot .qc-feedback-btn:hover {
		background: #F2F2F2;
		color: var(--qc-cb-maroon);
	}
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-btn {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-btn[aria-pressed="true"] {
	background: #343432;
	color: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-status,
html[data-theme="dark"] .qc-chatbot .qc-feedback-count,
html[data-theme="dark"] .qc-chatbot .qc-feedback-notice {
	color: #A8A8A7;
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-reason,
html[data-theme="dark"] .qc-chatbot .qc-feedback-comment,
html[data-theme="dark"] .qc-chatbot .qc-feedback-skip {
	background: #1D1D1B;
	border-color: #4A4A49;
	color: #FFFFFF;
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-skip {
	border-color: #CD96A2;
	color: #CD96A2;
}

html[data-theme="dark"] .qc-chatbot .qc-feedback-chip[aria-pressed="true"] {
	background: #911731;
	border-color: #911731;
	color: #FFFFFF;
}

@media (hover: hover) and (pointer: fine) {
	html[data-theme="dark"] .qc-chatbot .qc-feedback-btn:hover {
		background: #343432;
		color: #CD96A2;
	}
}

/* The counter is set dir="ltr" so its digits read "24 / 500"; keep it on the
   panel's end edge in Arabic too. */
.qc-chatbot[dir="rtl"] .qc-feedback-count {
	text-align: left;
}

/* ADO 151114 / 152784 - On mobile the launcher sat on top of a modal's own
   controls (the Submit Request button of the Media Dept popups, the Close
   Details button of the certificate popup). qc-chatbot.js sets html.qc-dialog-open
   while a dialog is actually visible; with the chat itself closed the launcher
   yields, and returns when the dialog closes. */
@media (max-width: 767.98px) {
	html.qc-dialog-open .qc-chatbot:not(.is-open) .qc-launcher-wrap {
		opacity: 0;
		pointer-events: none;
		visibility: hidden;
	}
}
