/**
 * Floating assistant.
 *
 * The theme's header is `position: sticky; z-index: 9999`. The panel sits above it, because
 * a launcher that scrolls under the navigation looks broken — but it is anchored to the
 * bottom-right, so it never covers the header in practice.
 */

.sigob-fab {
	position: fixed;
	/* Segundo lugar de la columna flotante de la esquina inferior derecha: encima
	   del botón de "ir arriba" y debajo del de compartir. La geometría —distancia al
	   borde, lado del círculo y separación— la declara el tema en :root para que las
	   tres piezas coincidan; los valores de reserva reproducen la posición histórica
	   por si este plugin se usa en otro tema. */
	right: var( --sigob-flot-derecha, 22px );
	bottom: calc(
		var( --sigob-flot-abajo, 22px ) + var( --sigob-flot-lado, 54px ) + var( --sigob-flot-hueco, 12px )
	);
	z-index: 10000;
	font-size: 15px;
	line-height: 1.6;
}

.sigob-fab__button {
	width: var( --sigob-flot-lado, 54px );
	height: var( --sigob-flot-lado, 54px );
	border: 0;
	border-radius: 50%;
	background: linear-gradient( 155deg, #0b8ec4 0%, #00689c 55%, #023047 100% );
	color: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 12px 28px -10px rgba( 2, 48, 71, 0.65 ), 0 0 0 1px rgba( 255, 255, 255, 0.10 ) inset;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.sigob-fab__button:hover,
.sigob-fab__button:focus-visible {
	transform: translateY( -2px );
	box-shadow: 0 18px 34px -10px rgba( 2, 48, 71, 0.7 ), 0 0 0 1px rgba( 255, 255, 255, 0.16 ) inset;
}

.sigob-fab__button:focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 3px;
}

.sigob-fab.is-open .sigob-fab__button {
	transform: scale( 0.9 );
	opacity: 0.75;
}

.sigob-fab__panel {
	position: absolute;
	right: 0;
	bottom: 68px;
	width: min( 420px, calc( 100vw - 44px ) );
	max-height: min( 640px, calc( 100vh - 130px ) );
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba( 2, 48, 71, 0.10 );
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 32px 70px -26px rgba( 2, 48, 71, 0.55 ), 0 2px 8px -2px rgba( 2, 48, 71, 0.12 );
}

.sigob-fab__panel[hidden] {
	display: none;
}

/*
 * El tema aplica reglas con !important al SELECTOR DE ELEMENTO `header`
 * ("header, .site-header { background: rgba(255,255,255,.98) !important; position:
 * sticky !important; top: 0 !important; z-index: 1000 !important }"). La cabecera de
 * este panel es un <header>, así que las heredaba todas: perdía su fondo navy —dejando
 * el texto claro sobre blanco, ilegible— y encima se volvía sticky dentro del panel.
 *
 * Se neutralizan una por una, con la especificidad del contenedor más !important, que
 * es lo único que gana contra una declaración !important del tema. Se mantiene el
 * <header> porque semánticamente corresponde: es la cabecera de la sección.
 */
.sigob-fab .sigob-fab__head {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 13px 15px;
	/* Degradado corto sobre el navy institucional: da profundidad sin quitarle sobriedad. */
	background: linear-gradient( 160deg, #023047 0%, #0f2233 100% ) !important;
	color: #fff !important;
	position: static !important;
	top: auto !important;
	z-index: auto !important;
	box-shadow: none !important;
	border: 0 !important;
}

.sigob-fab__avatar {
	flex: 0 0 auto;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba( 255, 255, 255, 0.14 );
}

.sigob-fab__ident {
	flex: 1;
	min-width: 0;
}

.sigob-fab__head strong {
	display: flex;
	align-items: baseline;
	gap: 7px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
}

/* El rol va junto al nombre, en minúscula y peso ligero: identifica sin competir. */
.sigob-fab__role {
	font-size: 11.5px;
	font-weight: 400;
	color: rgba( 234, 246, 255, 0.72 );
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sigob-fab__here {
	display: block;
	margin-top: 1px;
	font-size: 12px;
	color: rgba( 234, 246, 255, 0.72 );
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sigob-fab__here em {
	font-style: normal;
	font-weight: 600;
	color: #9fe8ff;
}

/* Etiqueta solo para lectores de pantalla. */
.sigob-fab__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;
}

.sigob-fab__close {
	border: 0;
	background: transparent;
	color: rgba( 255, 255, 255, 0.7 );
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

.sigob-fab__close:hover {
	color: #fff;
}

.sigob-fab__tabs {
	display: flex;
	border-bottom: 1px solid rgba( 15, 34, 51, 0.1 );
	background: #f6f8fa;
}

.sigob-fab__tab {
	flex: 1;
	border: 0;
	background: transparent;
	padding: 10px 8px;
	font: inherit;
	font-size: 13.5px;
	color: #5b6b7c;
	cursor: pointer;
	border-bottom: 2px solid transparent;
}

.sigob-fab__tab.is-active {
	color: #0f2233;
	font-weight: 600;
	border-bottom-color: #00689c;
	background: #fff;
}

.sigob-fab__body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	min-height: 130px;
}

.sigob-fab__hint {
	margin: 0;
	/* #6b7c8d quedaba en 4,29:1 sobre blanco; AA pide 4,5. Este llega a 5,3. */
	color: #5a6b7b;
	font-size: 14px;
}

.sigob-fab__msg {
	margin: 0 0 14px;
	font-size: 14.5px;
}

.sigob-fab__msg:last-child {
	margin-bottom: 0;
}

.sigob-fab__msg--user {
	background: #eef2f7;
	border-radius: 10px;
	padding: 8px 12px;
	margin-left: auto;
	width: fit-content;
	max-width: 88%;
}

.sigob-fab__msg--pending,
.sigob-fab__msg--ok {
	color: #5b6b7c;
}

.sigob-fab__msg--error {
	background: #fdf0ef;
	border-left: 3px solid #c0392b;
	padding: 8px 12px;
	color: #8e2b21;
}

.sigob-fab__msg ul,
.sigob-fab__msg ol {
	margin: 6px 0 6px 18px;
	padding: 0;
}

.sigob-fab__sources {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px dashed rgba( 15, 34, 51, 0.16 );
	font-size: 12.5px;
	color: #5b6b7c;
}

.sigob-fab__sources ol {
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.sigob-fab__sources li {
	margin: 2px 0;
}

.sigob-fab__form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba( 15, 34, 51, 0.1 );
	background: #f6f8fa;
	align-items: flex-end;
}

.sigob-fab__form textarea {
	flex: 1;
	resize: none;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 11px;
	border: 1px solid rgba( 15, 34, 51, 0.2 );
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	background: #fff;
}

.sigob-fab__form button {
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: #00689c;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.sigob-fab__form button:disabled {
	opacity: 0.55;
	cursor: default;
}

.sigob-fab__dots i {
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-right: 2px;
	border-radius: 50%;
	background: #9a9a9a;
	animation: sigob-fab-blink 1.3s infinite both;
}

.sigob-fab__dots i:nth-child( 2 ) { animation-delay: 0.2s; }
.sigob-fab__dots i:nth-child( 3 ) { animation-delay: 0.4s; }

@keyframes sigob-fab-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

@media ( max-width: 600px ) {
	/* La posición ya no se repite acá: el tema cambia --sigob-flot-derecha en este
	   mismo corte y las tres piezas de la columna se mueven juntas. Repetirla era
	   justamente lo que las dejaba desalineadas en el teléfono. */
	.sigob-fab__panel {
		width: calc( 100vw - 2 * var( --sigob-flot-derecha, 14px ) );
		max-height: calc( 100vh - 190px );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sigob-fab__button,
	.sigob-fab__dots i {
		transition: none;
		animation: none;
	}
}


/* Foco visible en los controles del panel. */
.sigob-fab__form textarea:focus-visible,
.sigob-fab__form button:focus-visible,
.sigob-fab__tab:focus-visible,
.sigob-fab__close:focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 2px;
}

.sigob-fab__form textarea:focus {
	border-color: #00689c;
	box-shadow: 0 0 0 3px rgba( 0, 104, 156, 0.14 );
}

.sigob-fab__form button:hover {
	background: #023047;
}

/* Barra de hilo: hace visible que hay contexto acumulado y ofrece la salida. */
.sigob-fab__hilo {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: #eef6fa;
	border-bottom: 1px solid rgba( 2, 48, 71, 0.10 );
	font-size: 12px;
	color: #3d5566;
}

.sigob-fab__hilo[hidden] {
	display: none;
}

.sigob-fab__hilo-txt {
	flex: 1;
	line-height: 1.35;
}

.sigob-fab__reset {
	flex: 0 0 auto;
	border: 1px solid #00689c;
	background: #fff;
	color: #00689c;
	border-radius: 6px;
	padding: 4px 10px;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.sigob-fab__reset:hover {
	background: #00689c;
	color: #fff;
}

.sigob-fab__reset:focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 2px;
}

