/**
 * SIGOB Wiki chat widget.
 *
 * Neutral styling on purpose: the widget is embedded inside the SIGOB theme, so it inherits
 * the page font and stays visually quiet rather than imposing its own identity.
 */

.sigob-wiki-chat {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 10px;
	background: #fff;
	font-size: 15px;
	line-height: 1.6;
	max-width: 820px;
	margin-inline: auto;
}

.sigob-wiki-chat__head {
	padding: 12px 16px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
	background: #fafafa;
}

.sigob-wiki-chat__title {
	font-weight: 600;
	font-size: 15px;
}

/**
 * The log grows with its content instead of scrolling inside itself.
 *
 * A scroll container nested in a page that already scrolls means the answer gets clipped at
 * both ends: the question scrolls out of view above, and the input is pushed below the fold.
 * Letting the conversation extend the page keeps the whole exchange readable in one flow.
 */
.sigob-wiki-chat__log {
	padding: 16px;
}

.sigob-wiki-chat__empty {
	color: #6b6b6b;
	margin: 0;
}

.sigob-wiki-chat__msg {
	margin: 0 0 16px;
}

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

.sigob-wiki-chat__msg p:first-child {
	margin-top: 0;
}

.sigob-wiki-chat__msg p:last-child {
	margin-bottom: 0;
}

.sigob-wiki-chat__msg--user {
	background: #eef2f7;
	border-radius: 10px;
	padding: 10px 14px;
	margin-left: auto;
	max-width: 85%;
	width: fit-content;
}

.sigob-wiki-chat__msg--pending {
	color: #6b6b6b;
}

.sigob-wiki-chat__msg--error {
	background: #fdf0ef;
	border-left: 3px solid #c0392b;
	padding: 10px 14px;
	color: #8e2b21;
}

.sigob-wiki-chat__msg--bot ul,
.sigob-wiki-chat__msg--bot ol {
	margin: 8px 0 8px 20px;
	padding: 0;
}

.sigob-wiki-chat__msg--bot li {
	margin: 4px 0;
}

.sigob-cite {
	font-size: 11px;
	color: #2f6ba8;
	vertical-align: super;
	line-height: 0;
	white-space: nowrap;
}

.sigob-wiki-chat__sources {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed rgba( 0, 0, 0, 0.15 );
	font-size: 13px;
	color: #555;
}

.sigob-wiki-chat__sources > span {
	font-weight: 600;
	display: block;
	margin-bottom: 4px;
}

.sigob-wiki-chat__sources ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sigob-wiki-chat__sources li {
	margin: 3px 0;
}

.sigob-wiki-chat__num {
	color: #2f6ba8;
	font-variant-numeric: tabular-nums;
}

.sigob-wiki-chat__tag {
	font-size: 11px;
	background: #f3e6c8;
	color: #7a5a12;
	border-radius: 3px;
	padding: 1px 6px;
	margin-left: 4px;
}

.sigob-wiki-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
	background: #fafafa;
	align-items: flex-end;
}

.sigob-wiki-chat__form textarea {
	flex: 1;
	resize: vertical;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	border-radius: 8px;
	font: inherit;
	line-height: 1.5;
	background: #fff;
}

.sigob-wiki-chat__form button {
	padding: 11px 20px;
	border: 0;
	border-radius: 8px;
	background: #2f6ba8;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

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

.sigob-wiki-chat__note {
	margin: 0;
	padding: 8px 16px 12px;
	font-size: 12px;
	color: #757575;
	background: #fafafa;
}

.sigob-wiki-chat--locked {
	padding: 20px;
	text-align: center;
}

.sigob-wiki-chat .sigob-wiki-btn {
	display: inline-block;
	padding: 9px 18px;
	background: #2f6ba8;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
}

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

.sigob-wiki-chat__dots i:nth-child( 2 ) {
	animation-delay: 0.2s;
}

.sigob-wiki-chat__dots i:nth-child( 3 ) {
	animation-delay: 0.4s;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.sigob-wiki-chat__dots i {
		animation: none;
	}
}

@media ( max-width: 600px ) {
	.sigob-wiki-chat__form {
		flex-direction: column;
		align-items: stretch;
	}
}
