/* Ribes AI Chat - widget styles. Everything is scoped to #rac-root so the theme can't break it. */

#rac-root {
	--rac-accent: #FFD400;
	--rac-ink: #151515;
	--rac-mist: #F2F2EE;
	--rac-line: #DEDED8;
	--rac-go: #2BD46B;
	--rac-bottom: 20px;
	position: fixed;
	bottom: var(--rac-bottom);
	z-index: 2147483000;
	font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
	color: var(--rac-ink);
	text-align: start;
}
#rac-root.rac-left { left: 20px; }
#rac-root.rac-right { right: 20px; }

#rac-root *,
#rac-root *::before,
#rac-root *::after { box-sizing: border-box; }

#rac-root button {
	font: inherit;
	margin: 0;
	border: 0;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: 0;
	min-width: 0;
	line-height: 1.2;
}
#rac-root svg { display: block; }

/* Launcher: a taxi roof light - black body, yellow text, green "free" lamp */
#rac-root .rac-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px 12px 16px;
	background: var(--rac-ink);
	color: var(--rac-accent);
	border: 2px solid var(--rac-accent);
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
	transition: transform .15s ease;
}
#rac-root .rac-launcher:hover { transform: translateY(-2px); }
#rac-root .rac-lamp,
#rac-root .rac-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--rac-go);
	box-shadow: 0 0 0 3px rgba(43, 212, 107, .22), 0 0 10px var(--rac-go);
	flex: none;
}
#rac-root .rac-dot { width: 8px; height: 8px; box-shadow: 0 0 6px var(--rac-go); }
#rac-root.rac-open .rac-launcher { display: none; }

/* Panel */
#rac-root .rac-panel {
	position: absolute;
	bottom: 0;
	width: 370px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 55px rgba(0, 0, 0, .32);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom center;
	animation: rac-in .18s ease-out;
}
#rac-root.rac-left .rac-panel { left: 0; }
#rac-root.rac-right .rac-panel { right: 0; }
#rac-root .rac-panel[hidden] { display: none; }

@keyframes rac-in {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to { opacity: 1; transform: none; }
}

#rac-root .rac-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 12px 12px 16px;
	background: var(--rac-ink);
	color: #fff;
}
#rac-root .rac-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#rac-root .rac-name { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rac-root .rac-sub { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #cfcfca; }

#rac-root .rac-wa {
	flex: none;
	background: var(--rac-accent);
	color: var(--rac-ink);
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1;
}
#rac-root .rac-wa:hover { filter: brightness(1.05); }

#rac-root .rac-close {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	display: grid;
	place-items: center;
	padding: 0;
}
#rac-root .rac-close:hover { background: rgba(255, 255, 255, .12); }

#rac-root .rac-stripe { height: 5px; background: var(--rac-accent); flex: none; }

/* Messages */
#rac-root .rac-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	background: var(--rac-mist);
	display: flex;
	flex-direction: column;
	gap: 10px;
	overscroll-behavior: contain;
}
#rac-root .rac-msg {
	max-width: 86%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.5;
	overflow-wrap: anywhere;
	word-break: normal;
}
#rac-root .rac-b {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--rac-line);
	border-end-start-radius: 4px;
}
#rac-root .rac-u {
	align-self: flex-end;
	background: var(--rac-accent);
	color: var(--rac-ink);
	border-end-end-radius: 4px;
	white-space: pre-wrap;
}
#rac-root .rac-e {
	align-self: flex-start;
	background: #FFF3F1;
	border: 1px solid #F1C4BC;
	color: #6E1F14;
	border-end-start-radius: 4px;
}
#rac-root .rac-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
#rac-root .rac-msg strong { font-weight: 700; }
#rac-root .rac-li { display: block; position: relative; padding-inline-start: 14px; }
#rac-root .rac-li::before { content: "•"; position: absolute; inset-inline-start: 2px; }

#rac-root .rac-typing { display: inline-flex; gap: 5px; padding: 13px 14px; }
#rac-root .rac-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9a9a94;
	animation: rac-blink 1.2s infinite ease-in-out;
}
#rac-root .rac-typing span:nth-child(2) { animation-delay: .15s; }
#rac-root .rac-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rac-blink {
	0%, 80%, 100% { opacity: .3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* Input */
#rac-root .rac-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px 10px 8px;
	background: #fff;
	border-top: 1px solid var(--rac-line);
	position: relative;
}
#rac-root .rac-input {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	margin: 0;
	padding: 11px 12px;
	resize: none;
	border: 1px solid #CFCFC9;
	border-radius: 12px;
	background: #fff;
	color: var(--rac-ink);
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	box-shadow: none;
	outline: none;
}
#rac-root .rac-input:focus { border-color: var(--rac-ink); box-shadow: 0 0 0 2px var(--rac-accent); }
#rac-root .rac-send {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--rac-ink);
	color: var(--rac-accent);
	display: grid;
	place-items: center;
	padding: 0;
}
#rac-root .rac-send:disabled { opacity: .45; cursor: default; }
#rac-root [dir="rtl"] .rac-send svg { transform: scaleX(-1); }

#rac-root .rac-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

#rac-root .rac-privacy {
	margin: 0;
	padding: 0 12px 10px;
	background: #fff;
	font-size: 11.5px;
	line-height: 1.4;
	color: #6B6B65;
}

#rac-root button:focus-visible,
#rac-root a:focus-visible {
	outline: 3px solid var(--rac-accent);
	outline-offset: 2px;
}

/* Phones: panel becomes a bottom sheet */
@media (max-width: 480px) {
	#rac-root.rac-open { left: 0; right: 0; bottom: 0; }
	#rac-root.rac-open .rac-panel {
		left: 0;
		right: 0;
		width: 100%;
		max-width: 100%;
		height: 85vh;
		height: 85dvh;
		max-height: none;
		border-radius: 16px 16px 0 0;
	}
	#rac-root .rac-input { font-size: 16px; } /* stops iOS zooming in */
}

@media (prefers-reduced-motion: reduce) {
	#rac-root .rac-panel,
	#rac-root .rac-typing span { animation: none; }
	#rac-root .rac-launcher { transition: none; }
}
