/* Sporting Assistente – colori del sito (rosso #df2526, marrone #4A2500) */
.sa-root {
	--sa-red: #df2526;
	--sa-brown: #4a2500;
	--sa-bg: #ffffff;
	--sa-soft: #f3f1ef;
	--sa-text: #333333;
	position: fixed;
	bottom: 2%;
	z-index: 1060;
	font-family: "Lato", Tahoma, Geneva, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: var(--sa-text);
}
.sa-root *,
.sa-root *::before,
.sa-root *::after { box-sizing: border-box; }

.sa-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--sa-red);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	padding: 0;
}
.sa-launcher:hover,
.sa-launcher:focus-visible { background: var(--sa-brown); outline: 3px solid rgba(223, 37, 38, .35); outline-offset: 2px; }

.sa-panel {
	position: absolute;
	bottom: 68px;
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 520px;
	max-height: calc(100vh - 170px);
	display: flex;
	flex-direction: column;
	background: var(--sa-bg);
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
	overflow: hidden;
}
.sa-panel[hidden] { display: none; }

.sa-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--sa-red);
	color: #fff;
	padding: 10px 12px 10px 16px;
}
.sa-title {
	font-family: "Oswald", Helvetica, Arial, sans-serif;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
	text-transform: uppercase;
	letter-spacing: .5px;
}
.sa-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 1px 6px;
	font-size: 11px;
	background: #fff;
	color: var(--sa-red);
	border-radius: 3px;
	vertical-align: middle;
}
.sa-tools { display: flex; align-items: center; gap: 4px; }
.sa-reset {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 3px;
}
.sa-reset:hover,
.sa-reset:focus-visible,
.sa-close:hover,
.sa-close:focus-visible { background: rgba(255, 255, 255, .2); outline: none; }
.sa-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.sa-log {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: var(--sa-soft);
	-webkit-overflow-scrolling: touch;
}
.sa-msg {
	max-width: 88%;
	margin: 0 0 10px;
	padding: 8px 12px;
	border-radius: 12px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.sa-bot { background: #fff; border-top-left-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.sa-user { margin-left: auto; background: var(--sa-brown); color: #fff; border-top-right-radius: 3px; }
.sa-text { white-space: pre-line; text-align: left; }
.sa-root .sa-msg a { color: var(--sa-red); text-decoration: underline; }
.sa-root .sa-user a { color: #fff; }
.sa-sources { margin-top: 6px; font-size: 13px; color: #666; }

.sa-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.sa-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #999;
	animation: sa-dot 1.2s infinite ease-in-out;
}
.sa-typing span:nth-child(2) { animation-delay: .2s; }
.sa-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sa-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.sa-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e5e5e5;
	background: #fff;
	margin: 0;
}
.sa-root .sa-input {
	flex: 1;
	resize: none;
	height: 42px; /* il tema imposta 100px a tutte le caselle di testo */
	min-height: 42px;
	max-height: 120px;
	margin: 0;
	padding: 9px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font: inherit;
	font-size: 16px; /* evita lo zoom automatico su iPhone */
	color: var(--sa-text);
}
.sa-root .sa-input:focus { outline: 2px solid var(--sa-red); outline-offset: 0; border-color: transparent; }
.sa-root .sa-send {
	border: 0;
	border-radius: 4px;
	background: var(--sa-red);
	color: #fff;
	padding: 0 14px;
	font-size: 14px;
	text-transform: uppercase;
	cursor: pointer;
}
.sa-root .sa-send:disabled { opacity: .6; cursor: default; }
.sa-note { padding: 6px 12px 10px; font-size: 11px; line-height: 1.3; color: #777; background: #fff; text-align: left; }

/* Posizione: a sinistra in basso, oppure a destra sopra il pulsante "torna su" del tema */
.sa-left { left: 2%; }
.sa-left .sa-panel { left: 0; }
.sa-right { right: 2%; bottom: calc(2% + 62px); }
.sa-right .sa-launcher { margin-left: auto; }
.sa-right .sa-panel { right: 0; }

.sa-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #ccc; font-size: 12px; color: #a00; }

/* Telefono: finestra a tutta larghezza */
@media (max-width: 600px) {
	.sa-left { left: 12px; bottom: 16px; }
	.sa-right { right: 12px; bottom: 76px; }
	.sa-root.sa-is-open { left: 0; right: 0; bottom: 0; top: 0; }
	.sa-root.sa-is-open .sa-launcher { display: none; }
	.sa-root.sa-is-open .sa-panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
}
@media (prefers-reduced-motion: reduce) {
	.sa-typing span { animation: none; opacity: .6; }
}
