/* ===== Legacy processing modal ===== */
html.tsl-modal-open,
body.tsl-modal-open {
	overflow: hidden;
}

/* container + fade */
.tsl-modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	z-index: 10000;
	opacity: 0;
	transition: opacity .15s ease;
}

.tsl-modal.open {
	opacity: 1;
}

.tsl-modal[hidden] {
	display: none;
}

/* backdrop */
.tsl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

/* sheet (card) */
.tsl-sheet {
	position: relative;
	width: min(760px, 92vw);
	background: #0c0c0f;
	color: #fff;
	border: 1px solid #232334;
	border-radius: 16px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
	padding: 50px 50px 50px 45px;
}

/* hero */
.tsl-hero {
	display: grid;
	place-items: center;
	gap: 6px;
	margin: 8px 0 18px;
	text-align: center;
}

.tsl-hero__icon {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: radial-gradient(100% 100% at 20% 20%, #ce4182 0%, #6846fb 92%, #111224 100%);
	display: grid;
	place-items: center;
	font-size: 30px;
}

.tsl-title {
	margin: 10px 0 0;
	font-size: 28px;
	font-weight: 800;
}

.tsl-subtitle {
	margin: 0;
	color: #b8b8c6;
	font-size: 14px;
}

/* analysis card */
.tsl-card {
	background: #111218;
	border: 1px solid #1f2233;
	border-radius: 12px;
	padding: 16px 16px 14px;
	margin: 12px 0 18px;
}

.tsl-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.tsl-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #a78bfa;
	box-shadow: 0 0 12px rgba(167, 139, 250, .8);
}

/* ai summary + shimmer */
.tsl-summary {
	white-space: pre-wrap;
	color: #d8d8df;
	font-size: 14px;
	line-height: 1.55;
	margin: 10px 0 2px;
	min-height: 15.5em;
	position: relative;
}

.tsl-summary.thinking {
	color: transparent;
	-webkit-text-fill-color: transparent;
	background: linear-gradient(to right, rgba(255, 255, 255, .25) 20%, rgba(255, 255, 255, .95) 40%, rgba(255, 255, 255, .95) 60%, rgba(255, 255, 255, .25) 80%);
	background-size: 200% auto;
	background-clip: text;
	-webkit-background-clip: text;
	animation: tsl-shine 3.25s linear infinite;
	will-change: background-position;
}

@keyframes tsl-shine {
	to {
		background-position: -200% center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tsl-summary.thinking {
		animation: none;
	}
}

/* key facts */
.tsl-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 8px;
}

@media (max-width:640px) {
	.tsl-grid {
		grid-template-columns: 1fr;
	}
}

.tsl-kv {
	background: #0f1017;
	border: 1px solid #212235;
	border-radius: 12px;
	padding: 14px;
}

.tsl-k {
	color: #9aa;
	font-size: 12px;
	letter-spacing: .02em;
}

.tsl-v {
	font-size: 16px;
	font-weight: 700;
	margin-top: 2px;
}

/* actions */
.tsl-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin: 14px 0 4px;
}

.tsl-actions.column {
	flex-direction: column;
	align-items: stretch;
}

.tsl-btn {
	all: unset;
	cursor: pointer;
	padding: 11px 16px;
	border-radius: 12px;
	border: 1px solid #2b2b3a;
	background: #181927;
	color: #fff;
	font-weight: 700;
}

.tsl-btn:hover {
	background: #1e2030;
}

.tsl-btn.primary {
	border-color: #6d28d9;
	background: linear-gradient(90deg, #7c3aed, #5b21b6);
}

.tsl-btn.primary:hover {
	filter: brightness(1.08);
}

.tsl-btn.ghost {
	background: transparent;
}

.tsl-btn.primary.tsl-full {
	display: block;
	width: 100%;
	text-align: center;
}

.tsl-note {
	color: #8b8b95;
	font-size: 12px;
	text-align: center;
	margin-top: 8px;
}