/* Baton: tour and recorder. Everything is scoped to .baton-ui so themes can't leak in. */

.baton-ui {
	--baton-ink: #1d2327;
	--baton-muted: #50575e;
	--baton-paper: #fff;
	--baton-line: #dcdcde;
	--baton-accent: #2f5bea;
	--baton-accent-ink: #fff;
	--baton-rec: #d63638;
	--baton-radius: 10px;
	--baton-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);

	box-sizing: border-box;
	color: var(--baton-ink);
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
}

.baton-ui *,
.baton-ui *::before,
.baton-ui *::after {
	box-sizing: inherit;
}

@media (prefers-color-scheme: dark) {
	.baton-ui {
		--baton-ink: #f0f0f1;
		--baton-muted: #c3c4c7;
		--baton-paper: #1d2327;
		--baton-line: #3c434a;
		--baton-accent: #7b9cff;
		--baton-accent-ink: #10172a;
	}
}

/* buttons */

.baton-ui .baton-btn {
	appearance: none;
	background: var(--baton-paper);
	border: 1px solid var(--baton-line);
	border-radius: 999px;
	color: var(--baton-ink);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	margin: 0;
	min-height: 36px;
	padding: 10px 16px;
	text-decoration: none;
	box-shadow: none;
}

.baton-ui .baton-btn:hover {
	border-color: var(--baton-ink);
}

.baton-ui .baton-btn:focus-visible {
	outline: 2px solid var(--baton-accent);
	outline-offset: 2px;
}

.baton-ui .baton-btn:disabled {
	cursor: default;
	opacity: 0.6;
}

.baton-ui .baton-btn-primary {
	background: var(--baton-accent);
	border-color: var(--baton-accent);
	color: var(--baton-accent-ink);
}

.baton-ui .baton-btn-primary:hover {
	border-color: var(--baton-accent);
	filter: brightness(1.08);
}

.baton-ui .baton-btn-link {
	background: none;
	border-color: transparent;
	color: var(--baton-muted);
	font-weight: 400;
	padding: 10px 6px;
	text-decoration: underline;
}

.baton-ui .baton-btn-link:hover {
	border-color: transparent;
	color: var(--baton-ink);
}

/* tour */

.baton-spotlight {
	border-radius: 8px;
	box-shadow: 0 0 0 3px var(--baton-accent), 0 0 0 9999px rgba(0, 0, 0, 0.45);
	pointer-events: none;
	position: fixed;
	transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
	z-index: 999998;
}

/* a ring that keeps pulsing out from the spot to click */
.baton-spotlight::after {
	animation: baton-ring 1.6s ease-out infinite;
	border: 3px solid var(--baton-accent);
	border-radius: inherit;
	content: "";
	inset: -3px;
	position: absolute;
}

@keyframes baton-ring {
	0% {
		opacity: 0.9;
		transform: scale(1);
	}

	100% {
		opacity: 0;
		transform: scale(1.18);
	}
}

.baton-tip {
	--baton-arrow-x: 50%;

	background: var(--baton-paper);
	border-radius: var(--baton-radius);
	box-shadow: var(--baton-shadow);
	max-width: calc(100vw - 32px);
	padding: 16px 18px 12px;
	position: fixed;
	width: 330px;
	z-index: 999999;
}

/* the arrow points at the spotlight */
.baton-tip::before {
	background: var(--baton-paper);
	content: "";
	display: none;
	height: 14px;
	left: var(--baton-arrow-x);
	position: absolute;
	transform: translateX(-50%) rotate(45deg);
	width: 14px;
}

.baton-tip.baton-tip-below::before {
	display: block;
	top: -7px;
}

.baton-tip.baton-tip-above::before {
	bottom: -7px;
	display: block;
}

.baton-tip.baton-tip-centered {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.baton-ui .baton-tip-count {
	color: var(--baton-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.baton-tip-progress {
	background: var(--baton-line);
	border-radius: 999px;
	height: 4px;
	margin-bottom: 12px;
	overflow: hidden;
}

.baton-tip-progress span {
	background: var(--baton-accent);
	display: block;
	height: 100%;
	transition: width 0.3s ease;
}

.baton-ui .baton-tip-text {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 6px;
}

.baton-ui .baton-tip-hint {
	color: var(--baton-muted);
	font-size: 13px;
	margin: 0 0 14px;
	min-height: 1.45em;
}

.baton-tip-actions {
	align-items: center;
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.baton-ui .baton-tip-mark {
	font-size: 11px;
	margin: 10px 0 0;
	text-align: right;
}

.baton-ui .baton-tip-mark a {
	border-radius: 3px;
	color: var(--baton-muted);
	opacity: 0.8;
	text-decoration: none;
}

.baton-ui .baton-tip-mark a:hover {
	color: var(--baton-accent);
	opacity: 1;
	text-decoration: underline;
}

.baton-ui .baton-tip-mark a:focus-visible {
	opacity: 1;
	outline: 2px solid var(--baton-accent);
	outline-offset: 2px;
}

.baton-ui .baton-tip-skip {
	margin-right: auto;
	padding-left: 0;
}

.baton-continue {
	align-items: center;
	background: var(--baton-paper);
	border-radius: 999px;
	bottom: 20px;
	box-shadow: var(--baton-shadow);
	display: flex;
	gap: 4px;
	padding: 6px;
	position: fixed;
	right: 20px;
	z-index: 999999;
}

/* recorder */

.baton-recbar {
	align-items: center;
	background: var(--baton-paper);
	border-radius: 999px;
	bottom: 20px;
	box-shadow: var(--baton-shadow);
	display: flex;
	gap: 10px;
	left: 50%;
	padding: 6px 6px 6px 16px;
	position: fixed;
	transform: translateX(-50%);
	z-index: 999999;
}

.baton-recbar-dot {
	animation: baton-pulse 1.4s ease-in-out infinite;
	background: var(--baton-rec);
	border-radius: 50%;
	height: 10px;
	width: 10px;
}

.baton-recbar-count {
	color: var(--baton-muted);
	white-space: nowrap;
}

@keyframes baton-pulse {
	50% {
		opacity: 0.3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.baton-recbar-dot {
		animation: none;
	}

	.baton-spotlight,
	.baton-tip-progress span {
		transition: none;
	}

	.baton-spotlight::after {
		animation: none;
	}
}

.baton-recpanel {
	align-items: center;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 16px;
	position: fixed;
	z-index: 1000000;
}

.baton-recpanel-box {
	background: var(--baton-paper);
	border-radius: var(--baton-radius);
	box-shadow: var(--baton-shadow);
	margin: 0;
	max-width: 100%;
	padding: 22px;
	width: 440px;
}

.baton-ui #baton-recpanel-title {
	display: block;
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 10px;
}

.baton-ui #baton-recpanel-name {
	background: var(--baton-paper);
	border: 1px solid var(--baton-line);
	border-radius: 8px;
	color: var(--baton-ink);
	font: inherit;
	margin: 0;
	padding: 10px 12px;
	width: 100%;
}

.baton-ui .baton-recpanel-note,
.baton-ui .baton-recpanel-status {
	color: var(--baton-muted);
	font-size: 13px;
	margin: 10px 0 0;
}

.baton-ui .baton-recpanel-status:empty {
	display: none;
}

.baton-recpanel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}
