/* ==========================================================================
   VTU consortium - floating product assistant ("Ask the library")
   Same bubble and panel as MMA-TUP / SVKM_Keyclock, in the theme5 teal.
   Loaded from partials/commonfooterscript.html.
   ========================================================================== */
#appai-bubble,
#AppAssistantModal {
	--sv-blue: #0b6b34;
	--sv-blue-dark: #00481a;
	--sv-blue-deep: #00301a;
	--sv-blue-soft: #e5f1e8;
	--sv-sky: #12873f;
	--sv-sky-soft: #eef6f0;
	--sv-red: #00481a;
	--sv-ink: #1f2933;
	--sv-muted: #5b6770;
	--sv-subtle: #8a959e;
	--sv-line: #e2e8f0;
	--sv-bg: #f8f6f1;
	--sv-white: #ffffff;
	--sv-radius-sm: 6px;
	--sv-display: Roboto, "Segoe UI", Arial, sans-serif;
	--sv-sans: Roboto, "Segoe UI", Arial, sans-serif;
}

/* ==========================================================================
   Library Assistant (#appai-bubble, #AppAssistantModal) – the TUP / SVKM design
   ========================================================================== */
#appai-bubble {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1060;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 54px;
	padding: 0 20px 0 16px;
	border: 0;
	border-radius: 27px;
	background: var(--sv-blue) !important;
	color: #fff;
	font-family: var(--sv-sans);
	font-size: 14.5px;
	font-weight: 600;
	box-shadow: 0 12px 28px rgba(11, 29, 79, 0.32);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, width 0.2s ease;
}
#appai-bubble:hover {
	background: var(--sv-blue-dark) !important;
	transform: translateY(-2px);
}
#appai-bubble:focus-visible {
	outline: 3px solid var(--sv-sky);
	outline-offset: 3px;
}
#appai-bubble .appai-bubble-open svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: var(--sv-sky);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
#appai-bubble .appai-bubble-close {
	display: none;
	font-size: 28px;
	line-height: 1;
	font-weight: 300;
}
#appai-bubble.is-open {
	width: 54px;
	padding: 0;
	justify-content: center;
}
#appai-bubble.is-open .appai-bubble-open,
#appai-bubble.is-open .appai-bubble-label {
	display: none;
}
#appai-bubble.is-open .appai-bubble-close {
	display: block;
}
#AppAssistantModal {
	pointer-events: none;
	padding: 0 !important;
}
#AppAssistantModal .appai-dialog {
	position: fixed;
	right: 24px;
	bottom: 92px;
	width: 400px;
	max-width: calc(100vw - 32px);
	margin: 0;
	pointer-events: auto;
}
#AppAssistantModal.fade .appai-dialog {
	transform: translateY(16px) scale(0.98);
	opacity: 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
#AppAssistantModal.show .appai-dialog {
	transform: none;
	opacity: 1;
}
#AppAssistantModal .appai-panel {
	display: flex;
	flex-direction: column;
	height: min(620px, calc(100vh - 120px));
	border: 1px solid var(--sv-line);
	border-top: 0;
	border-radius: 10px;
	background: var(--sv-white);
	box-shadow: 0 28px 60px rgba(11, 29, 79, 0.28);
	overflow: hidden;
}
#AppAssistantModal .appai-panel .modal-body {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
}
.appai-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--sv-blue-deep);
	border-bottom: 3px solid var(--sv-sky);
}
.appai-avatar {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
}
.appai-avatar img {
	width: 30px;
	height: 30px;
	object-fit: contain;
}
.appai-head-text {
	flex: 1 1 auto;
	min-width: 0;
}
.appai-title {
	margin: 0;
	font-family: var(--sv-display);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
}
.appai-sub {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
}
.appai-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sv-subtle);
}
#AppAssistantModal.is-ready .appai-dot {
	background: #3fb672;
	box-shadow: 0 0 0 3px rgba(63, 182, 114, 0.25);
}
.appai-close {
	flex: none;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, 0.8);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.appai-close:hover,
.appai-close:focus-visible {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}
#appai-chat-box {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	background: var(--sv-bg);
}
#appai-chat-log {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px 16px 10px;
	scrollbar-width: thin;
}
.appai-welcome {
	padding: 4px 2px;
}
.appai-welcome h3 {
	margin: 10px 0 6px;
	font-family: var(--sv-display);
	font-size: 24px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--sv-blue-deep);
}
.appai-welcome p {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--sv-muted);
}
.appai-welcome .appai-chips-label {
	margin: 0 0 8px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--sv-subtle);
}
.appai-chips {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.appai-chip {
	position: relative;
	display: block;
	width: 100%;
	padding: 10px 34px 10px 14px;
	border: 1px solid var(--sv-line);
	border-left: 3px solid var(--sv-sky);
	border-radius: var(--sv-radius-sm);
	background: var(--sv-white);
	color: var(--sv-blue-deep);
	font-family: var(--sv-sans);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.appai-chip::after {
	content: "\2192";
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--sv-blue);
	transition: transform 0.15s ease;
}
.appai-chip:hover:not(:disabled) {
	border-color: var(--sv-blue);
	border-left-color: var(--sv-sky);
	background: var(--sv-blue-soft);
}
.appai-chip:hover:not(:disabled)::after {
	transform: translate(3px, -50%);
}
.appai-chip:disabled {
	opacity: 0.55;
	cursor: default;
}
.appai-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0 0 12px;
}
.appai-row.user {
	justify-content: flex-end;
}
.appai-row-avatar {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--sv-blue);
	color: var(--sv-sky);
	font-size: 12px;
}
#appai-chat-log .msg {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
#appai-chat-log .msg.user {
	background: var(--sv-blue);
	color: #fff;
	border-bottom-right-radius: 3px;
}
#appai-chat-log .msg.assistant {
	background: var(--sv-white);
	color: var(--sv-ink);
	border: 1px solid var(--sv-line);
	border-bottom-left-radius: 3px;
}
#appai-chat-log .msg.irrelevant {
	background: var(--sv-sky-soft);
	color: var(--sv-red);
	border-bottom-left-radius: 3px;
}
#appai-chat-log .msg.error {
	background: #fbeeea;
	color: #8a2a1a;
	border-bottom-left-radius: 3px;
}
.appai-typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}
.appai-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--sv-subtle);
	animation: appai-blink 1.2s infinite ease-in-out;
}
.appai-typing span:nth-child(2) {
	animation-delay: 0.15s;
}
.appai-typing span:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes appai-blink {
	0%, 80%, 100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}
#appai-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 12px;
	padding: 5px 5px 5px 14px;
	border: 1px solid var(--sv-line);
	border-radius: 24px;
	background: var(--sv-white);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#appai-input-row:focus-within {
	border-color: var(--sv-blue);
	box-shadow: 0 0 0 3px rgba(29, 63, 158, 0.12);
}
#appai-question-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 14px;
	color: var(--sv-ink);
	outline: 0;
}
#appai-send-trigger {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--sv-blue);
	color: #fff;
	cursor: pointer;
}
#appai-send-trigger svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}
#appai-send-trigger:hover:not(:disabled) {
	background: var(--sv-blue-dark);
}
#appai-send-trigger:disabled {
	background: var(--sv-line);
	color: var(--sv-subtle);
	cursor: default;
}
.appai-note {
	margin: 8px 0 10px;
	padding: 0 16px;
	font-size: 11px;
	text-align: center;
	color: var(--sv-subtle);
}
@media (max-width: 575.98px) {
	#appai-bubble {
		right: 16px;
		bottom: 16px;
		width: 54px;
		padding: 0;
		justify-content: center;
	}
	#appai-bubble .appai-bubble-label {
		display: none;
	}
	#AppAssistantModal .appai-dialog {
		right: 8px;
		left: 8px;
		bottom: 80px;
		width: auto;
		max-width: none;
	}
	#AppAssistantModal .appai-panel {
		height: calc(100vh - 100px);
	}
}


/* small caps label in the welcome screen */
.ix-kicker {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--sv-sans);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--sv-red);
}
.ix-kicker::before {
	content: "";
	width: 28px;
	height: 1px;
	background: var(--sv-sky);
