/* Ramaya Live Chat — Lombok Boat brand (not WA green, not AI purple) */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Source+Sans+3:wght@400;600;700&display=swap");

.rlc-root {
	--rlc-sea: #0b3d5c;
	--rlc-sea-2: #14729a;
	--rlc-foam: #f3f7f9;
	--rlc-ink: #102a3a;
	--rlc-muted: #5b7383;
	--rlc-line: rgba(16, 42, 58, 0.1);
	--rlc-radius: 18px;
	--rlc-shadow: 0 22px 60px rgba(11, 61, 92, 0.28);
	font-family: "Source Sans 3", "Segoe UI", sans-serif;
	position: fixed;
	bottom: 1.25rem;
	z-index: 99980;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.75rem;
}

/* Unified hub: hide standalone FABs (panels/modals stay usable) */
#rlc-fab,
#rcn-toggle.rcn-floating-btn {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	width: 0 !important;
	height: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	position: absolute !important;
	left: -9999px !important;
}

/* Keep RCN modal docked bottom-right even if FAB is hidden */
#rcn-widget {
	pointer-events: none;
}
#rcn-widget #rcn-modal {
	pointer-events: auto;
}

/* Hide WhatsApp Chat Now FAB + chat hub while Ramaya Live Chat session/panel is open */
body.rlc-session-active #rcn-widget,
body.rlc-session-active #rcn-toggle.rcn-floating-btn,
#rcn-widget.is-rlc-hidden,
#rcn-widget.is-rlc-hidden #rcn-toggle,
body.rlc-session-active #rchat-hub,
body.rlc-session-active #rchat-hub-fab,
body:has(#rlc-root.is-open) #rchat-hub,
body:has(#rlc-root.is-open) #rchat-hub-fab,
#rlc-root.is-open ~ #rchat-hub {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transform: scale(0.85) !important;
}

body.rlc-session-active #rchat-opt-wa {
	opacity: 0.45;
	pointer-events: none;
}

.rlc-root.is-left {
	left: 1.25rem;
	right: auto;
	align-items: flex-start;
}

.rlc-root.is-right {
	right: 1.25rem;
	left: auto;
}

.rlc-root[hidden] { display: none !important; }

.rlc-fab {
	width: 58px;
	height: 58px;
	border-radius: 999px;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(145deg, var(--rlc-sea-2), var(--rlc-sea));
	box-shadow: var(--rlc-shadow);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rlc-fab:hover { transform: translateY(-2px) scale(1.03); }

.rlc-fab__badge:not([hidden]) {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: #e11d48;
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.rlc-panel {
	width: min(380px, calc(100vw - 1.5rem));
	height: min(560px, calc(100vh - 6.5rem));
	background: #fff;
	border-radius: var(--rlc-radius);
	box-shadow: var(--rlc-shadow);
	border: 1px solid var(--rlc-line);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transform-origin: bottom right;
	animation: rlc-open 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.rlc-root.is-left .rlc-panel { transform-origin: bottom left; }

.rlc-panel[hidden] { display: none !important; }

@keyframes rlc-open {
	from { opacity: 0; transform: translateY(12px) scale(0.96); }
	to { opacity: 1; transform: none; }
}

.rlc-panel__head {
	padding: 0.95rem 1rem;
	background:
		radial-gradient(500px 120px at 0% 0%, rgba(20, 114, 154, 0.35), transparent 55%),
		linear-gradient(135deg, #0b3d5c, #0f4f6f);
	color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.rlc-panel__brand {
	display: block;
	font-family: Fraunces, Georgia, serif;
	font-size: 1.15rem;
	font-weight: 700;
}

.rlc-panel__status {
	display: block;
	font-size: 0.75rem;
	opacity: 0.85;
	margin-top: 0.15rem;
}

.rlc-panel__close {
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	font-size: 1.25rem;
	cursor: pointer;
	line-height: 1;
}

.rlc-prechat {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	background: var(--rlc-foam);
}

/* Theme [hidden] resets often lack !important; display:flex would keep form visible */
.rlc-prechat[hidden],
.rlc-composer[hidden],
.rlc-attach-preview[hidden],
.rlc-hint[hidden],
.rlc-fab__badge[hidden] {
	display: none !important;
}

.rlc-prechat__lead {
	margin: 0 0 0.35rem;
	color: var(--rlc-muted);
	font-size: 0.9rem;
}

.rlc-prechat label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--rlc-ink);
}

.rlc-prechat input,
.rlc-composer textarea {
	border: 1px solid var(--rlc-line);
	border-radius: 12px;
	padding: 0.55rem 0.7rem;
	font: inherit;
	font-size: 0.9rem;
	background: #fff;
}

.rlc-btn {
	border: 0;
	border-radius: 12px;
	padding: 0.65rem 0.9rem;
	font-weight: 700;
	cursor: pointer;
	background: var(--rlc-sea);
	color: #fff;
}

.rlc-btn--send { padding: 0.55rem 0.85rem; }

.rlc-messages {
	flex: 1;
	overflow: auto;
	padding: 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	background:
		radial-gradient(800px 280px at 100% 0%, rgba(20, 114, 154, 0.08), transparent 50%),
		#fff;
}

.rlc-bubble {
	max-width: 85%;
	padding: 0.65rem 0.8rem;
	border-radius: 16px;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--rlc-ink);
}

.rlc-bubble--guest {
	align-self: flex-end;
	background: var(--rlc-sea);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.rlc-bubble--ai,
.rlc-bubble--agent,
.rlc-bubble--system {
	align-self: flex-start;
	background: #eef5f8;
	border-bottom-left-radius: 4px;
}

.rlc-bubble--agent { background: #dcefe7; }
.rlc-bubble--system {
	align-self: center;
	background: transparent;
	color: var(--rlc-muted);
	font-size: 0.75rem;
}

.rlc-bubble__who {
	display: block;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.7;
	margin-bottom: 0.2rem;
}

.rlc-pay-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.55rem;
	padding: 0.65rem 1rem;
	border-radius: 999px;
	background: #0b6e4f;
	color: #fff !important;
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none !important;
	box-shadow: 0 6px 16px rgba(11, 110, 79, 0.28);
}
.rlc-pay-btn:hover,
.rlc-pay-btn:focus {
	background: #095c42;
	color: #fff !important;
}

.rlc-bubble img {
	max-width: 180px;
	border-radius: 10px;
	margin-top: 0.35rem;
	cursor: zoom-in;
}

.rlc-composer {
	border-top: 1px solid var(--rlc-line);
	padding: 0.55rem 0.6rem 0.65rem;
	background: #f7fafc;
}

.rlc-composer__row {
	display: flex;
	align-items: flex-end;
	gap: 0.4rem;
}

.rlc-composer textarea {
	flex: 1;
	resize: none;
	max-height: 110px;
	min-height: 42px;
	border-radius: 22px;
	padding: 0.6rem 0.9rem;
	line-height: 1.35;
	border: 1px solid var(--rlc-line);
	background: #fff;
}

.rlc-composer__action {
	position: relative;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}

.rlc-action {
	position: absolute;
	inset: 0;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: linear-gradient(145deg, var(--rlc-sea-2), var(--rlc-sea));
	box-shadow: 0 8px 18px rgba(11, 61, 92, 0.28);
	transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	touch-action: none;
}

.rlc-action--mic,
.rlc-action--mic svg {
	touch-action: none;
	pointer-events: auto;
}

.rlc-action--mic svg {
	pointer-events: none;
}

.rlc-action[hidden] {
	display: none !important;
}

.rlc-action:active {
	transform: scale(0.94);
}

.rlc-action--mic.is-recording {
	background: linear-gradient(145deg, #fb7185, #be123c);
	box-shadow: 0 0 0 6px rgba(190, 18, 60, 0.18);
	animation: rlc-mic-pulse 1s ease-in-out infinite;
}

@keyframes rlc-mic-pulse {
	0%, 100% { box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.16); }
	50% { box-shadow: 0 0 0 10px rgba(190, 18, 60, 0.08); }
}

.rlc-icon {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	border: 0;
	background: transparent;
	color: var(--rlc-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

.rlc-btn--send { display: none; }

.rlc-attach-preview {
	display: flex;
	gap: 0.4rem;
	margin-bottom: 0.45rem;
	flex-wrap: wrap;
}

.rlc-chip {
	width: 56px;
	height: 56px;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	border: 1px solid var(--rlc-line);
}

.rlc-chip img { width: 100%; height: 100%; object-fit: cover; }

.rlc-chip--audio {
	width: auto;
	min-width: 88px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0 0.55rem 0 0.65rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--rlc-sea);
	background: #eef5f8;
}

.rlc-voice {
	margin-top: 0.35rem;
	min-width: 180px;
}

.rlc-voice audio {
	width: 100%;
	max-width: 240px;
	height: 36px;
}

.rlc-chip button {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 16px;
	height: 16px;
	border: 0;
	border-radius: 999px;
	background: rgba(0,0,0,.65);
	color: #fff;
	font-size: 10px;
	cursor: pointer;
}

.rlc-hint {
	margin: 0.35rem 0 0;
	font-size: 0.72rem;
	color: #b45309;
}

.rlc-typing {
	align-self: flex-start;
	font-size: 0.78rem;
	color: var(--rlc-muted);
	padding: 0.25rem 0.4rem;
}

/* Mobile: chat session full-width, pinned to bottom */
@media (max-width: 720px) {
	.rlc-root.is-open {
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100%;
		max-width: 100vw;
		align-items: stretch;
		gap: 0;
		padding: 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		box-sizing: border-box;
	}

	.rlc-root.is-open .rlc-fab {
		display: none;
	}

	.rlc-root.is-open .rlc-panel {
		width: 100%;
		max-width: none;
		height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
		max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
		border-radius: 18px 18px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		transform-origin: bottom center;
		box-shadow: 0 -12px 40px rgba(11, 61, 92, 0.22);
	}

	.rlc-root.is-open .rlc-messages {
		min-height: 0;
		flex: 1 1 auto;
		overscroll-behavior: contain;
	}

	.rlc-root.is-open .rlc-composer {
		flex-shrink: 0;
		padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
		position: sticky;
		bottom: 0;
		z-index: 2;
	}

	.rlc-root.is-open .rlc-panel__head {
		flex-shrink: 0;
		border-radius: 18px 18px 0 0;
	}
}

/* ===== Unified chat hub (Live Chat + WA Chat) ===== */
.rchat-hub {
	--rchat-sea: #0b3d5c;
	--rchat-sea-2: #14729a;
	--rchat-wa: #198754;
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 99995;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.7rem;
	font-family: "Source Sans 3", "Segoe UI", sans-serif;
	pointer-events: none;
}

.rchat-hub[hidden] { display: none !important; }

.rchat-hub > * { pointer-events: auto; }

.rchat-hub__fab {
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(145deg, var(--rchat-sea-2), var(--rchat-sea));
	box-shadow: 0 18px 40px rgba(11, 61, 92, 0.32);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.rchat-hub__fab:hover { transform: translateY(-2px) scale(1.03); }

.rchat-hub.is-open .rchat-hub__fab {
	background: #102a3a;
}

.rchat-hub__fab-icon { display: inline-flex; line-height: 0; }
.rchat-hub__fab-icon--close { display: none; }
.rchat-hub.is-open .rchat-hub__fab-icon--chat { display: none; }
.rchat-hub.is-open .rchat-hub__fab-icon--close { display: inline-flex; }

.rchat-hub__badge:not([hidden]) {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: #e11d48;
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.rchat-hub__menu {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	min-width: 12.5rem;
	animation: rchat-hub-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.rchat-hub__menu[hidden] { display: none !important; }

@keyframes rchat-hub-rise {
	from { opacity: 0; transform: translateY(0.55rem) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.rchat-hub__opt {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	width: 100%;
	margin: 0;
	padding: 0.65rem 0.8rem;
	border: 1px solid rgba(16, 42, 58, 0.1);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 14px 36px rgba(11, 61, 92, 0.16);
	color: #102a3a;
	cursor: pointer;
	text-align: left;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.rchat-hub__opt:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 40px rgba(11, 61, 92, 0.2);
}

.rchat-hub__opt-ico {
	flex: 0 0 auto;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.rchat-hub__opt--live .rchat-hub__opt-ico {
	background: linear-gradient(145deg, var(--rchat-sea-2), var(--rchat-sea));
}

.rchat-hub__opt--wa .rchat-hub__opt-ico {
	background: var(--rchat-wa);
}

.rchat-hub__opt-txt {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	min-width: 0;
}

.rchat-hub__opt-txt strong {
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.2;
}

.rchat-hub__opt-txt small {
	font-size: 0.72rem;
	color: #5b7383;
	line-height: 1.2;
}

@media (max-width: 720px) {
	.rchat-hub {
		right: 1rem;
		bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.rlc-panel, .rlc-fab, .rchat-hub__fab, .rchat-hub__menu { animation: none !important; transition: none !important; }
}
