/* Arkansas Spine & Pain patient assistant (assets/assistant/ui.js). */

.asap-asst,
.asap-asst__launcher {
	--asst-blue: #2f3192;
	--asst-blue-deep: #1f2170;
	--asst-navy: #12143f;
	--asst-ink: #16172b;
	--asst-ink-2: #474a5e;
	--asst-line: #8a8da0; /* 3.3:1 on white, for control borders */
	--asst-soft: #eceefb;
	--asst-mist: #f3f4f8;
	--asst-focus: #a84c06; /* 5.5:1 on white */
	--asst-alert: #b3261e;
	--asst-gap: 1rem;
	/* Phones: the theme's fixed action bar takes the bottom 3.5rem. */
	--asst-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	--asst-top: calc(var(--wp-admin--admin-bar--height, 0px) + 5rem);
	font-family: inherit;
	color: var(--asst-ink);
}
@media (max-width: 639.98px) {
	.asap-asst {
		--asst-bottom: calc(3.5rem + 0.75rem + env(safe-area-inset-bottom, 0px));
		--asst-top: calc(var(--wp-admin--admin-bar--height, 0px) + 4.75rem);
	}
}

.asap-asst__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Launcher */
.asap-asst__launcher {
	position: fixed;
	right: var(--asst-gap);
	bottom: var(--asst-bottom);
	z-index: 39; /* below the sticky header (40) and its menu */
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 3rem;
	min-width: 3rem;
	padding: 0 1.125rem;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	background: var(--asst-blue);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 10px 30px -10px rgba(18, 20, 63, 0.55);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.asap-asst__launcher:hover { background: var(--asst-blue-deep); }
.asap-asst__launcher[aria-expanded="true"]:not(.in-bar) { display: none; }

/* Phones: the launcher sits in the theme's bottom "Quick actions" bar (Call · Find a clinic · Ask ASAP). */
.asap-asst__launcher.in-bar {
	position: static;
	flex-direction: column;
	justify-content: center;
	gap: 0.125rem;
	min-height: 3.5rem;
	padding: 0 0.25rem;
	border: 0;
	border-left: 1px solid #e2e4ec;
	border-radius: 0;
	background: transparent;
	color: var(--asst-blue, #2f3192);
	font-size: 0.8125rem;
	line-height: 1.2;
	box-shadow: none;
}
.asap-asst__launcher.in-bar:hover { background: #eceefb; }
.asap-asst__launcher.in-bar[aria-expanded="true"] { background: #eceefb; box-shadow: inset 0 3px 0 #2f3192; }
.asap-asst__launcher.in-bar:focus-visible { outline: 3px solid #a84c06; outline-offset: -3px; }
@media print { .asap-asst { display: none !important; } }

/* Panel (dialog) */
.asap-asst__panel {
	position: fixed;
	right: var(--asst-gap);
	bottom: var(--asst-bottom);
	z-index: 39;
	display: flex;
	flex-direction: column;
	width: min(25rem, calc(100vw - 2 * var(--asst-gap)));
	height: min(40rem, calc(100dvh - var(--asst-top) - var(--asst-bottom)));
	max-height: calc(100vh - var(--asst-top) - var(--asst-bottom));
	border: 1px solid #d5d7e2;
	border-radius: 1.25rem;
	background: #fff;
	box-shadow: 0 24px 60px -20px rgba(18, 20, 63, 0.45);
	overflow: hidden;
}
.asap-asst__panel[hidden] { display: none; }
@media (max-width: 639.98px) {
	.asap-asst__panel {
		left: 0.5rem;
		right: 0.5rem;
		top: var(--asst-top);
		bottom: calc(3.5rem + 0.5rem + env(safe-area-inset-bottom, 0px));
		width: auto;
		height: auto;
		max-height: none;
	}
}

.asap-asst__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.25rem 0.25rem 0.25rem 1rem;
	background: var(--asst-navy);
	color: #fff;
}
.asap-asst__title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}
.asap-asst__title:focus { outline: none; }
.asap-asst__title:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.asap-asst__tools { display: flex; align-items: center; }
.asap-asst__icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 0.75rem;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.asap-asst__icon-btn[hidden] { display: none; }
.asap-asst__head .asap-asst__icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.asap-asst__head .asap-asst__icon-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 2px #fff; }
.asap-asst__head .asap-asst__icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

.asap-asst__notice {
	margin: 0;
	padding: 0.625rem 1rem;
	background: var(--asst-mist);
	border-bottom: 1px solid #e2e4ec;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--asst-ink-2);
}
.asap-asst__notice strong { color: var(--asst-ink); }

.asap-asst__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0.75rem 1rem;
}
.asap-asst__log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.asap-asst__msg { max-width: 92%; }
.asap-asst__msg p {
	margin: 0;
	padding: 0.625rem 0.875rem;
	border-radius: 1rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	white-space: pre-line;
	overflow-wrap: anywhere;
}
.asap-asst__msg--you { justify-self: end; }
.asap-asst__msg--you p { background: var(--asst-blue); color: #fff; border-bottom-right-radius: 0.25rem; }
.asap-asst__msg--bot p { background: var(--asst-soft); color: var(--asst-ink); border-bottom-left-radius: 0.25rem; }
.asap-asst__msg--alert p { background: #fdecea; color: #5f1410; border: 2px solid var(--asst-alert); font-weight: 600; }

.asap-asst__links { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.asap-asst__link,
.asap-asst__chip {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--asst-line);
	border-radius: 999px;
	background: #fff;
	color: var(--asst-blue);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.asap-asst__link:hover,
.asap-asst__chip:hover { border-color: var(--asst-blue); background: var(--asst-soft); }
.asap-asst__link { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.asap-asst__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.asap-asst__caption {
	margin: 0.75rem 0 0;
	padding: 0.5rem 0.75rem;
	border-left: 3px solid var(--asst-blue);
	font-style: italic;
	color: var(--asst-ink-2);
}
.asap-asst__caption[hidden] { display: none; }

.asap-asst__form {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 0.75rem;
	border-top: 1px solid #e2e4ec;
}
.asap-asst__input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 2.75rem;
	padding: 0 0.875rem;
	border: 1px solid var(--asst-line);
	border-radius: 999px;
	background: #fff;
	color: var(--asst-ink);
	font: inherit;
	font-size: 1rem; /* 16px keeps iOS from zooming */
}
.asap-asst__input::placeholder { color: #62657a; }
.asap-asst__mic { color: var(--asst-blue); border: 1px solid var(--asst-line); border-radius: 999px; }
.asap-asst__mic[aria-pressed="true"] { background: var(--asst-alert); border-color: var(--asst-alert); color: #fff; }
.asap-asst__send {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 2.75rem;
	min-width: 2.75rem;
	padding: 0 0.875rem;
	border: 0;
	border-radius: 999px;
	background: var(--asst-blue);
	color: #fff;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}
.asap-asst__send:hover { background: var(--asst-blue-deep); }

.asap-asst__person {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom, 0px) * 0);
	border-top: 1px solid #e2e4ec;
	background: #fff;
	color: var(--asst-navy);
	font-size: 0.9375rem;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}
.asap-asst__person:hover { background: var(--asst-mist); }

/* Focus: visible on every control */
.asap-asst__launcher:focus-visible,
.asap-asst__link:focus-visible,
.asap-asst__chip:focus-visible,
.asap-asst__send:focus-visible,
.asap-asst__mic:focus-visible,
.asap-asst__input:focus-visible,
.asap-asst__person:focus-visible {
	outline: 3px solid var(--asst-focus);
	outline-offset: 2px;
}
.asap-asst__person:focus-visible { outline-offset: -4px; }

.asap-asst.is-listening .asap-asst__mic { animation: asap-asst-pulse 1.2s ease-in-out infinite; }
@keyframes asap-asst-pulse { 50% { box-shadow: 0 0 0 6px rgba(179, 38, 30, 0.25); } }

@media (prefers-reduced-motion: reduce) {
	.asap-asst *,
	.asap-asst *::before,
	.asap-asst *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media (forced-colors: active) {
	.asap-asst__launcher,
	.asap-asst__panel,
	.asap-asst__msg p,
	.asap-asst__link,
	.asap-asst__chip,
	.asap-asst__send { border: 1px solid CanvasText; }
}
