/* Asia AI Bot — front-end widget, directory & profile (inherits site theme fonts) */

.aicb-root,
.aicb-directory,
.aicb-profile,
.aicb-profile-page {
	--aicb-color: #4f46e5;
	--aicb-bg-color: #f7f7f9;
	--aicb-radius: 16px;
	--aicb-border: color-mix(in srgb, currentColor 14%, transparent);
	--aicb-muted: color-mix(in srgb, currentColor 55%, transparent);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	color: inherit;
	box-sizing: border-box;
}

.aicb-root *,
.aicb-directory *,
.aicb-profile *,
.aicb-profile-page * {
	box-sizing: border-box;
}

.aicb-root button,
.aicb-root input,
.aicb-root textarea,
.aicb-root select,
.aicb-directory button,
.aicb-directory input,
.aicb-directory select,
.aicb-directory textarea,
.aicb-profile button,
.aicb-profile a,
.aicb-profile-page button,
.aicb-profile-page a {
	font-family: inherit;
}

/* Floating positioning */
.aicb-root[data-mode="floating"] {
	position: fixed;
	z-index: 99999;
	bottom: 20px;
}

.aicb-root.aicb-bottom-right {
	right: 20px;
}

.aicb-root.aicb-bottom-left {
	left: 20px;
}

/* Launcher */
.aicb-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--aicb-color);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.aicb-launcher:hover {
	transform: scale(1.05);
}

.aicb-launcher-has-icon {
	padding: 0;
	overflow: hidden;
	background: #fff;
	border: 2px solid var(--aicb-color);
}

.aicb-launcher-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

/* Panel */
.aicb-panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: var(--aicb-radius);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
	overflow: hidden;
	font-family: inherit;
	color: inherit;
}

.aicb-root[data-mode="floating"] .aicb-panel {
	position: absolute;
	bottom: 76px;
	right: 0;
}

.aicb-root.aicb-bottom-left .aicb-panel {
	right: auto;
	left: 0;
}

.aicb-root.aicb-closed .aicb-panel {
	display: none;
}

.aicb-root.aicb-inline .aicb-panel {
	height: 600px;
	margin: 0 auto;
}

/* Header */
.aicb-header {
	background: var(--aicb-color);
	color: #fff;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.aicb-title {
	font-weight: 600;
	font-size: 1em;
	font-family: inherit;
}

.aicb-tokens {
	margin-left: auto;
	font-size: 0.7em;
	font-family: inherit;
	opacity: 0.9;
	background: rgba(255, 255, 255, 0.18);
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
	max-width: 55%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aicb-header-spacer {
	margin-left: auto;
}

.aicb-new-chat {
	background: rgba(255, 255, 255, 0.18);
	border: none;
	color: #fff;
	font-size: 0.75em;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 10px;
	white-space: nowrap;
}

.aicb-new-chat:hover {
	background: rgba(255, 255, 255, 0.28);
}

.aicb-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

/* Messages */
.aicb-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background-color: var(--aicb-bg-color, #f7f7f9);
	background-image: none;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* PNG sits behind a tinted color overlay so both show. */
.aicb-root.aicb-has-bg-image .aicb-messages {
	background-image:
		linear-gradient(var(--aicb-bg-overlay, rgba(247, 247, 249, 0.78)), var(--aicb-bg-overlay, rgba(247, 247, 249, 0.78))),
		var(--aicb-bg-image);
	background-size: cover, cover;
	background-position: center, center;
	background-repeat: no-repeat, no-repeat;
}

.aicb-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 100%;
}

.aicb-msg-assistant {
	align-self: flex-start;
}

.aicb-msg-user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.aicb-msg-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: #e8e8ee;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aicb-msg-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aicb-msg-avatar-bot {
	background: var(--aicb-color);
	color: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.aicb-msg-avatar-user {
	background: #d0d0d8;
	color: #444;
}

.aicb-msg-avatar-fallback {
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.aicb-bubble {
	max-width: calc(100% - 36px);
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 0.95em;
	font-family: inherit;
	line-height: 1.45;
	word-wrap: break-word;
}

.aicb-bubble-assistant {
	background: #fff;
	border: 1px solid var(--aicb-border, #e6e6ea);
	border-bottom-left-radius: 4px;
	color: inherit;
}

.aicb-bubble-user {
	background: var(--aicb-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.aicb-typing .aicb-bubble-text {
	opacity: 0.6;
	font-style: italic;
}

.aicb-bubble-rich .aicb-md-p {
	margin: 0 0 0.65em;
}

.aicb-bubble-rich .aicb-md-p:last-child {
	margin-bottom: 0;
}

.aicb-bubble-rich .aicb-md-h {
	margin: 0.85em 0 0.4em;
	font-size: 0.95em;
	font-weight: 700;
	line-height: 1.3;
	color: #222;
}

.aicb-bubble-rich .aicb-md-h:first-child {
	margin-top: 0;
}

.aicb-bubble-rich .aicb-md-ol,
.aicb-bubble-rich .aicb-md-ul {
	margin: 0.35em 0 0.75em;
	padding-left: 1.25em;
}

.aicb-bubble-rich .aicb-md-ol li,
.aicb-bubble-rich .aicb-md-ul li {
	margin: 0.25em 0;
}

.aicb-bubble-rich a {
	color: var(--aicb-color);
	text-decoration: underline;
}

.aicb-bubble-rich strong {
	font-weight: 700;
}

/* Choices */
.aicb-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.aicb-choices-label {
	font-size: 13px;
	color: #555;
	font-weight: 600;
}

.aicb-choice {
	text-align: left;
	background: #fff;
	border: 1px solid var(--aicb-color);
	color: var(--aicb-color);
	padding: 10px 12px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.15s ease, color 0.15s ease;
}

.aicb-choice:hover {
	background: var(--aicb-color);
	color: #fff;
}

/* Recommendation cards */
.aicb-cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aicb-cards-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.aicb-cards-count {
	font-size: 12px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.aicb-cards-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.aicb-cards-toggle {
	width: 100%;
	border: 1px dashed #c9c9d1;
	background: #f3f3f6;
	color: #333;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.aicb-cards-toggle:hover {
	background: #ebebf0;
	border-color: var(--aicb-color);
	color: var(--aicb-color);
}

.aicb-rec-card {
	background: #fff;
	border: 1px solid #e6e6ea;
	border-radius: 12px;
	padding: 12px;
}

.aicb-rec-image {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 8px;
}

.aicb-rec-name {
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 2px;
}

.aicb-rec-meta {
	font-size: 12px;
	color: #666;
}

.aicb-rec-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--aicb-color);
	margin-top: 4px;
}

.aicb-rec-snippet {
	font-size: 12px;
	color: #555;
	margin-top: 6px;
	line-height: 1.4;
}

.aicb-rec-actions {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	flex-wrap: wrap;
}

.aicb-rec-btn {
	font-size: 13px;
	padding: 7px 12px;
	border-radius: 8px;
	text-decoration: none;
	border: 1px solid var(--aicb-color);
	color: var(--aicb-color);
	background: #fff;
	cursor: pointer;
}

.aicb-rec-btn-primary {
	background: var(--aicb-color);
	color: #fff;
}

/* Input */
.aicb-input-bar {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e6e6ea;
	background: #fff;
}

.aicb-input {
	flex: 1;
	border: 1px solid var(--aicb-border, #d7d7dd);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 1em;
	font-family: inherit;
	color: inherit;
	outline: none;
}

.aicb-input:focus {
	border-color: var(--aicb-color);
}

.aicb-send {
	background: var(--aicb-color);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 1em;
	font-family: inherit;
}

.aicb-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Directory */
.aicb-directory {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.aicb-directory *,
.aicb-directory *::before,
.aicb-directory *::after {
	box-sizing: border-box;
}

.aicb-directory-filter {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
	gap: 10px;
	align-items: stretch;
	margin-bottom: 20px;
}

.aicb-directory-filter select,
.aicb-directory-filter input,
.aicb-directory-filter button {
	width: 100%;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--aicb-border, #d7d7dd);
	border-radius: 8px;
	font-size: 1em;
	line-height: 1.3;
	font-family: inherit;
	color: inherit;
	background: #fff;
}

.aicb-directory-filter button {
	background: var(--aicb-color, #2563eb);
	color: #fff;
	border-color: var(--aicb-color, #2563eb);
	cursor: pointer;
	white-space: nowrap;
}

.aicb-directory-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.aicb-card {
	border: 1px solid var(--aicb-border, #e6e6ea);
	border-radius: 12px;
	padding: 16px;
	background: #fff;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	font-family: inherit;
	color: inherit;
}

.aicb-card-header-row {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.aicb-card-intro {
	min-width: 0;
}

.aicb-card-avatar {
	margin-bottom: 0;
}

.aicb-card-avatar img {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: color-mix(in srgb, currentColor 8%, #fff);
}

.aicb-card-title {
	margin: 0 0 4px;
	font-size: 1.05em;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.35;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	color: inherit;
}

.aicb-card-speciality {
	color: var(--aicb-color, #2563eb);
	font-weight: 600;
	margin: 0 0 4px;
	font-size: 0.95em;
	font-family: inherit;
	word-wrap: break-word;
}

.aicb-card-location {
	color: var(--aicb-muted, #666);
	margin: 0 0 8px;
	font-size: 0.9em;
	font-family: inherit;
}

.aicb-card-detail {
	font-size: 0.9em;
	margin: 2px 0;
	font-family: inherit;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.aicb-card-actions {
	display: flex;
	gap: 8px;
	margin-top: auto;
	padding-top: 12px;
	flex-wrap: wrap;
}

.aicb-card-actions .aicb-btn {
	flex: 1 1 auto;
	text-align: center;
	min-width: 0;
}

/* Tablet */
@media (max-width: 992px) {
	.aicb-directory-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.aicb-directory-filter {
		grid-template-columns: 1fr 1fr;
	}

	.aicb-directory-filter button {
		grid-column: 1 / -1;
	}
}

/* Mobile */
@media (max-width: 640px) {
	.aicb-directory-filter {
		grid-template-columns: 1fr;
		gap: 8px;
		margin-bottom: 16px;
	}

	.aicb-directory-filter button {
		grid-column: auto;
		padding: 12px;
	}

	.aicb-directory-grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.aicb-card {
		padding: 14px;
	}

	.aicb-card-header-row {
		flex-direction: row;
		gap: 12px;
		align-items: flex-start;
	}

	.aicb-card-avatar {
		flex: 0 0 auto;
		margin-bottom: 0;
	}

	.aicb-card-avatar img {
		width: 64px;
		height: 64px;
	}

	.aicb-card-title {
		font-size: 15px;
	}

	.aicb-card-speciality {
		font-size: 13px;
	}

	.aicb-card-location {
		font-size: 12px;
		margin-bottom: 0;
	}

	.aicb-card-actions {
		flex-direction: column;
		padding-top: 10px;
		margin-top: 10px;
	}

	.aicb-card-actions .aicb-btn {
		width: 100%;
		padding: 11px 14px;
	}

	.aicb-pagination {
		justify-content: center;
		flex-wrap: wrap;
	}
}

/* Small phones */
@media (max-width: 380px) {
	.aicb-card-avatar img {
		width: 56px;
		height: 56px;
	}
}

.aicb-btn {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 8px;
	text-decoration: none;
	border: 1px solid var(--aicb-color, #2563eb);
	color: var(--aicb-color, #2563eb);
	font-size: 0.95em;
	font-family: inherit;
	line-height: 1.3;
	box-sizing: border-box;
	background: transparent;
}

.aicb-btn-primary {
	background: var(--aicb-color, #2563eb);
	color: #fff;
	border-color: var(--aicb-color, #2563eb);
}

.aicb-btn-outline,
.aicb-profile .aicb-btn:not(.aicb-btn-primary) {
	display: inline-block !important;
	padding: 8px 16px !important;
	border: 1px solid var(--aicb-color, #2563eb) !important;
	border-radius: 8px !important;
	color: var(--aicb-color, #2563eb) !important;
	background: #fff !important;
	text-decoration: none !important;
	font-size: 14px !important;
	line-height: 1.3 !important;
	box-sizing: border-box !important;
}

.aicb-pagination {
	display: flex;
	gap: 6px;
	margin-top: 24px;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
}

.aicb-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	padding: 8px 12px;
	border: 1px solid var(--aicb-border, #d7d7dd);
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	font-size: 0.95em;
	font-family: inherit;
	line-height: 1;
	background: #fff;
	box-sizing: border-box;
}

.aicb-page.is-active {
	background: var(--aicb-color, #2563eb);
	color: #fff;
	border-color: var(--aicb-color, #2563eb);
	pointer-events: none;
}

.aicb-page-nav {
	font-weight: 700;
}

.aicb-page.is-disabled {
	opacity: 0.4;
	cursor: default;
	pointer-events: none;
}

.aicb-empty {
	color: #666;
}

.aicb-login-gate {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 8px 4px 16px;
}

.aicb-login-text {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.45;
	font-family: inherit;
	color: inherit;
}

.aicb-login-btn {
	display: inline-block;
}

/* Single professional profile page wrapper */
.aicb-profile-page {
	padding: 2rem 1rem;
	font-family: inherit;
	color: inherit;
}

.aicb-profile-page-inner {
	max-width: 800px;
	margin: 0 auto;
}

/* Single professional profile */
.aicb-profile {
	max-width: 760px;
	margin: 0 auto 2rem;
	background: #fff;
	border: 1px solid var(--aicb-border, #e6e6ea);
	border-radius: 12px;
	padding: 24px;
	font-family: inherit;
	color: inherit;
}

.aicb-profile-header {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.aicb-profile-avatar img,
.aicb-profile-avatar-default {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: color-mix(in srgb, currentColor 8%, #fff);
}

.aicb-profile-intro {
	flex: 1;
	min-width: 200px;
}

.aicb-profile-title {
	margin: 0 0 6px;
	font-size: 1.6em;
	font-family: inherit;
	font-weight: 700;
	line-height: 1.25;
	color: inherit;
}

.aicb-profile-speciality {
	margin: 0 0 4px;
	color: var(--aicb-color, #2563eb);
	font-weight: 600;
	font-family: inherit;
	font-size: 1em;
}

.aicb-profile-location {
	margin: 0 0 12px;
	color: var(--aicb-muted, #666);
	font-family: inherit;
	font-size: 0.95em;
}

.aicb-profile-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.aicb-profile-back {
	margin: 0 0 8px;
}

.aicb-profile-bio,
.aicb-profile-details {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--aicb-border, #eee);
	font-family: inherit;
}

.aicb-profile-bio h3,
.aicb-profile-details h3 {
	margin: 0 0 10px;
	font-size: 1.1em;
	font-family: inherit;
	font-weight: 600;
	color: inherit;
}

.aicb-profile-dl {
	margin: 0;
	font-family: inherit;
}

.aicb-profile-row {
	display: grid;
	grid-template-columns: minmax(120px, 180px) 1fr;
	gap: 8px 16px;
	padding: 8px 0;
	border-bottom: 1px solid var(--aicb-border, #f3f3f5);
	font-family: inherit;
}

.aicb-profile-row dt {
	margin: 0;
	font-weight: 600;
	color: inherit;
	font-family: inherit;
}

.aicb-profile-row dd {
	margin: 0;
	color: inherit;
	font-family: inherit;
	word-wrap: break-word;
}

.aicb-profile-row dd a {
	color: var(--aicb-color, #2563eb);
	font-family: inherit;
}

@media (max-width: 520px) {
	.aicb-profile-row {
		grid-template-columns: 1fr;
	}
}
