/**
 * Warp Scan — marketing demo card: score panel + example AI chat.
 * Self-contained: shares no rules with scanner.css or report.css.
 * px units on purpose: the site theme sets a 10px root font size.
 */

.wsd {
	--wsd-bg: #0f0f0f;
	--wsd-panel: #161616;
	--wsd-line: #2e2e2e;
	--wsd-ink: #f6f8fc;
	--wsd-ink-2: #d4d4d4;
	--wsd-ink-3: #a3a3a3;
	--wsd-accent: #3b82f6;
	--wsd-accent-ink: #93c5fd;
	--wsd-user: #2563eb;
	--wsd-ok: #6ee7a0;
	--wsd-warn: #f5b942;
	--wsd-tone: var(--wsd-warn);
	--wsd-font: var(--warp-font, "DM Sans", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
	--wsd-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

	box-sizing: border-box;
	width: 100%;
	max-width: 540px;
	margin: 0 auto;
	padding: 0;
	font-family: var(--wsd-font);
	font-size: 15px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

.wsd *,
.wsd *::before,
.wsd *::after {
	box-sizing: border-box;
}

.wsd[data-tone="mid"] {
	--wsd-tone: #e9c84a;
}

.wsd[data-tone="good"] {
	--wsd-tone: var(--wsd-ok);
}

.wsd__card {
	color: var(--wsd-ink);
	text-align: left;
	background: var(--wsd-bg);
	border: 1px solid var(--wsd-line);
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 60px -30px rgba(0, 0, 0, 0.7);
	overflow: hidden;
	transition: opacity 0.4s ease-out;
}

.wsd.is-resetting .wsd__card {
	opacity: 0.25;
}

/* ---- Header ---- */

.wsd__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--wsd-line);
}

.wsd__brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.wsd__dot {
	width: 8px;
	height: 8px;
	background: var(--wsd-accent);
	border-radius: 50%;
}

.wsd__site {
	color: var(--wsd-ink-3);
	font-family: var(--wsd-mono);
	font-size: 12.5px;
}

/* ---- Score panel ---- */

.wsd__main {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 20px;
}

.wsd__score {
	position: relative;
	flex: 0 0 112px;
	width: 112px;
	height: 112px;
}

.wsd__ring {
	display: block;
	transform: rotate(-90deg);
}

.wsd__ring-track,
.wsd__ring-value {
	fill: none;
	stroke-width: 8;
}

.wsd__ring-track {
	stroke: var(--wsd-line);
}

.wsd__ring-value {
	stroke: var(--wsd-tone);
	stroke-linecap: round;
	transition: stroke 0.4s ease-out;
}

.wsd__score-num {
	position: absolute;
	inset: 26px 0 auto;
	color: var(--wsd-tone);
	font-size: 38px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	text-align: center;
	transition: color 0.4s ease-out;
}

.wsd__score-label {
	position: absolute;
	inset: 70px 0 auto;
	color: var(--wsd-ink-3);
	font-size: 9px;
	letter-spacing: 0.06em;
	text-align: center;
	text-transform: uppercase;
}

.wsd__stats {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px 12px;
	margin: 0;
}

.wsd__stat {
	min-width: 0;
	margin: 0;
}

.wsd__stat dt {
	margin: 0 0 2px;
	overflow: hidden;
	color: var(--wsd-ink-3);
	font-size: 12px;
	font-weight: 400;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wsd__stat dd {
	margin: 0;
	color: var(--wsd-ink);
	font-size: 19px;
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* A number a fix just moved glows green for a moment. */
.wsd__stat.is-changed dd {
	animation: wsd-flash 1.6s ease-out;
}

@keyframes wsd-flash {
	0%,
	35% {
		color: var(--wsd-ok);
	}
}

/* ---- Chat ---- */

.wsd__chat {
	background: var(--wsd-panel);
	border-top: 1px solid var(--wsd-line);
}

.wsd__chat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 20px;
	border-bottom: 1px solid var(--wsd-line);
}

.wsd__chat-title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	color: var(--wsd-ink-2);
	font-size: 13px;
	font-weight: 600;
}

.wsd__agent-dot {
	flex: none;
	width: 8px;
	height: 8px;
	background: #22c55e;
	border-radius: 50%;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.wsd__mcp {
	flex: none;
	padding: 2px 7px;
	color: var(--wsd-ink-2);
	font-family: var(--wsd-mono);
	font-size: 11px;
	border: 1px solid var(--wsd-line);
	border-radius: 6px;
}

/* Fixed height so the card never changes size; it scrolls like a chat. */
.wsd__log {
	height: 300px;
	padding: 14px 20px 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--wsd-line) transparent;
}

.wsd__log:focus-visible {
	outline: 2px solid var(--wsd-accent);
	outline-offset: -2px;
}

.wsd__sys {
	margin: 0 0 14px;
	color: var(--wsd-ink-3);
	font-family: var(--wsd-mono);
	font-size: 11.5px;
	text-align: center;
}

.wsd__msg {
	display: flex;
	margin: 0 0 12px;
	animation: wsd-in 0.28s ease-out both;
}

@keyframes wsd-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

.wsd__msg--user {
	justify-content: flex-end;
}

.wsd__bubble {
	max-width: 85%;
	margin: 0;
	padding: 9px 14px;
	color: #ffffff;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	background: var(--wsd-user);
	border-radius: 16px 16px 4px 16px;
}

.wsd__text {
	margin: 0;
	color: var(--wsd-ink);
	font-size: 14px;
	line-height: 1.55;
}

/* Typing indicator. */
.wsd__typing {
	gap: 4px;
	align-items: center;
	height: 22px;
}

.wsd__typing span {
	width: 6px;
	height: 6px;
	background: var(--wsd-ink-3);
	border-radius: 50%;
	animation: wsd-dot 1s ease-in-out infinite;
}

.wsd__typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.wsd__typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes wsd-dot {
	0%,
	60%,
	100% {
		opacity: 0.3;
		transform: none;
	}

	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* MCP tool call. */
.wsd__tool {
	margin: 0 0 8px;
	padding: 7px 10px;
	font-family: var(--wsd-mono);
	font-size: 12px;
	line-height: 1.45;
	border: 1px dashed #3d3d3d;
	border-radius: 8px;
	animation: wsd-in 0.28s ease-out both;
}

.wsd__tool--write {
	border-color: rgba(59, 130, 246, 0.5);
}

.wsd__tool-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
}

.wsd__tool-state {
	position: relative;
	top: 2px;
	display: inline-block;
	flex: none;
	width: 11px;
	height: 11px;
	border: 1.5px solid var(--wsd-ink-3);
	border-top-color: transparent;
	border-radius: 50%;
	animation: wsd-spin 0.7s linear infinite;
}

@keyframes wsd-spin {
	to {
		transform: rotate(360deg);
	}
}

.wsd__tool.is-done .wsd__tool-state {
	top: 0;
	width: auto;
	height: auto;
	border: 0;
	animation: none;
}

.wsd__tool.is-done .wsd__tool-state::before {
	content: "✓";
	color: var(--wsd-ok);
}

.wsd__tool-name {
	color: var(--wsd-accent-ink);
}

.wsd__tool-ns {
	color: var(--wsd-ink-3);
}

.wsd__tool-args {
	color: var(--wsd-ink-2);
	word-break: break-word;
}

.wsd__tool-ms {
	margin-left: auto;
	color: var(--wsd-ok);
}

.wsd__tool-result {
	display: none;
	margin-top: 2px;
	padding-left: 19px;
	color: var(--wsd-ink-3);
}

.wsd__tool.is-done .wsd__tool-result {
	display: block;
}

/* Plain-language progress is the default; raw calls are an optional view. */
.wsd__tool-summary {
	font-family: var(--wsd-font);
	font-size: 13px;
	color: var(--wsd-ink-2);
}

.wsd:not(.is-technical) .wsd__tool-name,
.wsd:not(.is-technical) .wsd__tool-args,
.wsd:not(.is-technical) .wsd__tool-ms,
.wsd:not(.is-technical) .wsd__tool-result,
.wsd:not(.is-technical) .wsd__technical,
.wsd.is-technical .wsd__simple,
.wsd.is-technical .wsd__tool-summary {
	display: none;
}

.wsd__detail-controls {
	padding: 0 16px 12px;
}

.wsd__details {
	appearance: none;
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: var(--wsd-accent-ink);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.wsd__details:focus-visible {
	outline: 2px solid var(--wsd-accent);
	outline-offset: 3px;
}

/* ---- Example questions ---- */

.wsd__asks {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px 16px;
	border-top: 1px solid var(--wsd-line);
}

.wsd .wsd__ask {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	margin: 0;
	padding: 7px 14px;
	color: var(--wsd-ink-2);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	background: transparent;
	border: 1px solid var(--wsd-line);
	border-radius: 999px;
	box-shadow: none;
	transition: border-color 0.15s ease-out, color 0.15s ease-out, background-color 0.15s ease-out;
}

.wsd .wsd__ask:hover {
	color: var(--wsd-ink);
	background: transparent;
	border-color: var(--wsd-ink-3);
}

.wsd .wsd__ask:focus-visible {
	outline: 2px solid var(--wsd-accent);
	outline-offset: 2px;
}

.wsd .wsd__ask.is-active {
	color: var(--wsd-accent-ink);
	background: rgba(59, 130, 246, 0.12);
	border-color: var(--wsd-accent);
}

.wsd .wsd__ask:disabled {
	color: var(--wsd-ink-3);
	cursor: default;
	background: transparent;
	border-color: var(--wsd-line);
	opacity: 0.7;
}

.wsd__ask-tick {
	display: none;
	color: var(--wsd-ok);
}

.wsd__ask.is-done .wsd__ask-tick {
	display: inline;
}

.wsd__caption {
	margin: 10px 0 0;
	color: inherit;
	font-size: 12.5px;
	text-align: center;
	opacity: 0.65;
}

@media (max-width: 460px) {
	.wsd__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 18px 16px;
	}

	.wsd__head,
	.wsd__chat-head {
		padding-right: 16px;
		padding-left: 16px;
	}

	.wsd__stats {
		width: 100%;
	}

	.wsd__log {
		height: 340px;
		padding-right: 16px;
		padding-left: 16px;
	}

	.wsd__asks {
		padding-right: 12px;
		padding-left: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsd *,
	.wsd *::before,
	.wsd *::after {
		animation: none !important;
		transition: none !important;
	}
}
