:root {
	--bksearch-oac-brand: var(--bk-brand, #0073aa);
	--bksearch-oac-brand-hover: var(--bk-brand-hover, #0892d0);
	--bksearch-oac-surface: rgba(255, 255, 255, 0.96);
	--bksearch-oac-surface-soft: #f6f9fc;
	--bksearch-oac-line: rgba(18, 54, 79, 0.12);
	--bksearch-oac-line-strong: rgba(18, 54, 79, 0.18);
	--bksearch-oac-text: var(--bk-text, #20303d);
	--bksearch-oac-muted: #617282;
	--bksearch-oac-shadow: 0 28px 60px rgba(8, 33, 49, 0.18);
	--bksearch-oac-shadow-soft: 0 14px 28px rgba(8, 33, 49, 0.08);
}

.bksearch-oac-widget,
.bksearch-oac-widget * {
	box-sizing: border-box;
}

.bksearch-oac-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9999;
	color: var(--bksearch-oac-text);
	font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.bksearch-oac-widget--embedded {
	position: relative;
	right: auto;
	bottom: auto;
	max-width: 520px;
}

.bksearch-oac-shell {
	display: grid;
	justify-items: end;
	gap: 14px;
}

.bksearch-oac-widget--embedded .bksearch-oac-shell {
	justify-items: stretch;
}

.bksearch-oac-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--bksearch-oac-brand), var(--bksearch-oac-brand-hover));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 18px 36px rgba(0, 115, 170, 0.28);
	transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.bksearch-oac-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 22px 42px rgba(0, 115, 170, 0.32);
}

.bksearch-oac-toggle:focus-visible,
.bksearch-oac-close:focus-visible,
.bksearch-oac-form button[type="submit"]:focus-visible,
.bksearch-oac-form textarea:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.16);
}

.bksearch-oac-toggle__icon,
.bksearch-oac-form button[type="submit"] svg {
	display: inline-flex;
}

.bksearch-oac-toggle svg {
	width: 28px;
	height: 28px;
}

.bksearch-oac-widget.is-open .bksearch-oac-toggle {
	opacity: 0;
	transform: translateY(10px) scale(0.92);
	pointer-events: none;
}

.bksearch-oac-panel {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(390px, calc(100vw - 24px));
	height: min(640px, calc(100vh - 104px));
	border: 1px solid var(--bksearch-oac-line);
	border-radius: 24px;
	background:
		radial-gradient(circle at top right, rgba(0, 115, 170, 0.1), transparent 38%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98)),
		var(--bksearch-oac-surface);
	box-shadow: var(--bksearch-oac-shadow);
	backdrop-filter: blur(18px);
	overflow: hidden;
}

.bksearch-oac-widget--embedded .bksearch-oac-panel {
	width: 100%;
	min-height: 560px;
	height: min(640px, calc(100vh - 64px));
}

.bksearch-oac-panel[hidden] {
	display: none;
}

.bksearch-oac-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 18px 14px;
	border-bottom: 1px solid var(--bksearch-oac-line);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.55));
}

.bksearch-oac-panel__identity {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.bksearch-oac-avatar,
.bksearch-oac-message__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--bksearch-oac-brand), var(--bksearch-oac-brand-hover));
	color: #fff;
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: 0 10px 20px rgba(0, 115, 170, 0.18);
}

.bksearch-oac-panel__meta strong {
	display: block;
	font-size: 1rem;
	line-height: 1.2;
}

.bksearch-oac-panel__subtitle {
	margin-top: 4px;
	color: var(--bksearch-oac-muted);
	font-size: 0.82rem;
	line-height: 1.3;
}

.bksearch-oac-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--bksearch-oac-line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	color: var(--bksearch-oac-muted);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.bksearch-oac-messages {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px;
	overflow: auto;
	background:
		linear-gradient(180deg, rgba(0, 115, 170, 0.04), transparent 22%),
		var(--bksearch-oac-surface-soft);
}

.bksearch-oac-messages::-webkit-scrollbar {
	width: 10px;
}

.bksearch-oac-messages::-webkit-scrollbar-track {
	background: transparent;
}

.bksearch-oac-messages::-webkit-scrollbar-thumb {
	border: 3px solid transparent;
	border-radius: 999px;
	background: rgba(97, 114, 130, 0.34);
	background-clip: padding-box;
}

.bksearch-oac-message {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	max-width: 88%;
}

.bksearch-oac-message--assistant {
	align-self: flex-start;
}

.bksearch-oac-message--user {
	align-self: flex-end;
	margin-left: auto;
}

.bksearch-oac-message__avatar {
	width: 28px;
	height: 28px;
	margin-bottom: 4px;
	font-size: 0.62rem;
	box-shadow: none;
}

.bksearch-oac-message__bubble {
	padding: 12px 14px;
	border-radius: 18px;
	box-shadow: var(--bksearch-oac-shadow-soft);
}

.bksearch-oac-message--typing .bksearch-oac-message__bubble {
	padding: 14px 16px;
}

.bksearch-oac-message--assistant .bksearch-oac-message__bubble {
	border: 1px solid rgba(18, 54, 79, 0.08);
	border-bottom-left-radius: 8px;
	background: rgba(255, 255, 255, 0.98);
}

.bksearch-oac-message--user .bksearch-oac-message__bubble {
	border-bottom-right-radius: 8px;
	background: linear-gradient(135deg, var(--bksearch-oac-brand), var(--bksearch-oac-brand-hover));
	color: #fff;
}

.bksearch-oac-message__body {
	white-space: normal;
	font-size: 0.95rem;
	line-height: 1.58;
}

.bksearch-oac-message__body > * {
	margin: 0;
}

.bksearch-oac-message__body > * + * {
	margin-top: 10px;
}

.bksearch-oac-message__body ul,
.bksearch-oac-message__body ol {
	padding-left: 1.15rem;
}

.bksearch-oac-message__body li + li {
	margin-top: 6px;
}

.bksearch-oac-message__body strong {
	font-weight: 700;
}

.bksearch-oac-message__body code {
	padding: 0.08rem 0.34rem;
	border-radius: 7px;
	background: rgba(18, 54, 79, 0.08);
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.88em;
}

.bksearch-oac-message__body a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.14em;
}

.bksearch-oac-message--user .bksearch-oac-message__body code {
	background: rgba(255, 255, 255, 0.18);
}

.bksearch-oac-typing {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 34px;
	min-height: 20px;
}

.bksearch-oac-typing__dot {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: rgba(32, 48, 61, 0.74);
	animation: bksearch-oac-typing-dot 1.05s ease-in-out infinite;
}

.bksearch-oac-typing__dot:nth-child(2) {
	animation-delay: 0.16s;
}

.bksearch-oac-typing__dot:nth-child(3) {
	animation-delay: 0.32s;
}

@keyframes bksearch-oac-typing-dot {
	0%,
	80%,
	100% {
		transform: translateY(0);
		opacity: 0.3;
	}

	40% {
		transform: translateY(-2px);
		opacity: 1;
	}
}

.bksearch-oac-form {
	display: grid;
	gap: 8px;
	padding: 14px 16px 16px;
	border-top: 1px solid var(--bksearch-oac-line);
	background: rgba(255, 255, 255, 0.82);
}

.bksearch-oac-composer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 10px;
}

.bksearch-oac-form textarea {
	width: 100%;
	min-height: 48px;
	max-height: 144px;
	padding: 13px 15px;
	border: 1px solid var(--bksearch-oac-line-strong);
	border-radius: 18px;
	background: #fff;
	color: var(--bksearch-oac-text);
	font: inherit;
	line-height: 1.45;
	resize: none;
	overflow: hidden;
}

.bksearch-oac-form textarea::placeholder {
	color: rgba(97, 114, 130, 0.92);
}

.bksearch-oac-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--bksearch-oac-brand), var(--bksearch-oac-brand-hover));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(0, 115, 170, 0.18);
}

.bksearch-oac-form button[type="submit"] svg {
	width: 20px;
	height: 20px;
}

.bksearch-oac-form button[type="submit"]:disabled,
.bksearch-oac-form textarea:disabled {
	opacity: 0.72;
	cursor: not-allowed;
}

.bksearch-oac-status {
	min-height: 0;
	color: #9a3d3d;
	font-size: 0.82rem;
	line-height: 1.4;
}

.bksearch-oac-status:empty {
	display: none;
}

@media (max-width: 640px) {
	.bksearch-oac-widget {
		right: 12px;
		bottom: 12px;
		left: 12px;
	}

	.bksearch-oac-shell {
		justify-items: end;
	}

	.bksearch-oac-panel {
		width: min(100vw - 24px, 100%);
		height: min(78vh, 620px);
	}

	.bksearch-oac-widget--embedded .bksearch-oac-panel {
		height: min(78vh, 620px);
	}

	.bksearch-oac-message {
		max-width: 94%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bksearch-oac-toggle,
	.bksearch-oac-typing__dot {
		transition: none;
		animation: none;
	}
}
