/* Markdrop: drop a numbered comment pin on a live page.
   Tokens and rules ported from markdrop/src/app.css, src/lib/markdrop/css.ts,
   src/lib/components/viewers/pdf/pins.css and src/routes/f/[projectId]/+page.svelte.
   1rem is the product's 16px, scaled with the tile so the UI stays legible. */

:root {
	--stage: oklch(0.215 0.006 107);

	/* app.css */
	--foreground: oklch(0.145 0 0);
	--primary: oklch(0.4955 0.271289 294.5521);
	--primary-foreground: oklch(0.985 0 0);
	--primary-500: #6702e5;
	--muted-foreground: oklch(0.556 0 0);
	--accent: oklch(0.9703 0 0);
	--border-light: #eeeeee;
	--radius: 0.625rem;

	/* Tailwind palette values used by the source classes */
	--gray-200: oklch(0.928 0.006 264.531);
	--gray-400: oklch(0.707 0.022 261.325);
	--gray-700: oklch(0.373 0.034 259.733);
	--neutral-100: oklch(0.97 0 0);
	--neutral-200: oklch(0.922 0 0);
	--neutral-600: oklch(0.439 0 0);
	--neutral-700: oklch(0.371 0 0);
	--green-50: oklch(0.982 0.018 155.826);
	--green-600: oklch(0.627 0.194 149.214);

	/* css.ts */
	--pin: #0941ff;

	--font-sans: 'Geist', 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
	--xs: max(11px, 0.75rem);
}

html {
	font-size: clamp(13.75px, min(1.95vw, 3.12vh), 19.2px);
}

html,
body {
	height: 100%;
	margin: 0;
	overflow: hidden;
}

body {
	position: relative;
	background: var(--stage);
	color: var(--foreground);
	font-family: var(--font-sans);
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

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

[hidden] {
	display: none !important;
}

button,
textarea {
	font: inherit;
	color: inherit;
	margin: 0;
}

/* ---------- The page under review ---------- */

.page {
	position: absolute;
	inset: clamp(12px, 6vmin, 40px);
	border-radius: 0.625rem;
	box-shadow:
		0 0 0 1px rgb(255 255 255 / 0.06),
		0 30px 60px -30px rgb(0 0 0 / 0.55);
}

.surface {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	background: #fbfaf7;
	container-type: size;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	/* comment-mode cursor, from events.ts / pins.css */
	cursor: copy;
	cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAstJREFUSImtlV2IVVUYhp9vnW1HknGYJPEnCbVgCJrJn3Gg8CJInLwwvdCyggymEO9CC69kEC+UfpggwaBImyjyh0iR8Y+QJCqYLlLBfr2QcJQodZzIM3uv7/Vi5nDOqZk9M6de2LDXXu/3vd/7rb3WMklbgHYmjhJwFfgF6DWzy7lsSQdVP9xd30haOVb+BIgA84sZ6dD45TdMh1lzjeaHYeWaYE+utWXFqRx3V68Zz5vZn9V8k/QxsOGBuzNu/z2+wD8x+z54bWeBdS8Y7lwKgQ4z+7k8HwAHKBQmnxyg/zd4ZWPk1U7HI/PdOS7pnmqBCBBCfQJlfPK+s7UzWggsAHqqBRwg1OmgGoc+FD17HWBVeeEn1aLu/QW2dOVbfWO789cgLtFVFphwi1qWGEsfs1zOH7/DgX0ezGiXNO9/bVEZJz8XgAGrKgL/cZGr8X2fyq8LkrJAknybuOPtwKJllZY0zRDTGoyjXw/bLSTwwTvOwf2qiRu4AaXbeHEqcxJgAGBagwG1xJvXYXCwMo4RPFa+hQIM3hrdhQ3XVUqAfoBZc+DHC7WkN7u8ZvzFhYRr/WLDijh61hE0NsFdRQJwJQA/AbQszf87JoPWSq6LATgjcatjTVBOzKSwYrUhkQG9wcxKZnzW2oa1L893ce470fdVfh0z7oWnX7RoxjEzu2EAkhZKXDzXp+SpR6NlWf3V73438OxLwc14xMzOBwAz+9WMt1rbzLq6698Q6zcGnns5YMYeMztfMympIOmEJL3XHXV/kmouE3+2dkalqaKkM5KmjFqBpMayyLdnPXYszsZN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4vSnQqKmz4dcCRz8MAPJgnrFo8du34dgHiimlBsBOKj6iRnICM+bCJop2awFWxRmYkIfx7qj0bjr+HRzpUQINfGh0HNAhjYXbLGsLgwBaAEiwcFlYQgAN9cKgW1cFooAfIOENZjRQhF45Q3pi6ssqdZCEQB+qxuutYUjoIXc1hJNADimcWu77LySODKYh+Rxh0IyIWA5NYGDCnvX43SKS9oeHhfxTxqkNqGsXnXaSK0BbDg0hxILmI0YeYzsOPNIakI6QMAVBaQ8kiAJARnoWNp3hgHpGQnPGCK3/3A5W9Q4C6ysKsUeCHRFadMuPgFNA12hgV74sHiTVAYSYvKSjCSxyZcgYywq95zi+jZk8yR0cBE116J2a7u4ZoRUpIQzXASBlqjFVnCjgHMhzKcq/ergEhCIzKgjnmTdiOeBw5rSp5bIYMu1R+LD1k52Lbz2ppflxuhrc7PfV6WXODWh8OAhcD5b6++UBdV6+KPw3llw/7QkO1mMflkUdAJo9kDhZiEIrLSUxsxRZdMRA0Hhcr8uH4Aoeoke9NWDyBMyL2AuSp0HBk5vYg2dNXHJtx1RRv5eO4TIHXv7JjVaAxO3rLcbRgAmBFOyRN0ksfqkwMgjoyfBpdB0enrbWPuIGpZICvQQGldr+ZsTfiem86W4zgMj18poUmNlskQd9qS7pbfgRGWaCHKpxx841lGqXQo77w57b+SQRi+uU+S2ASxnd7ysNZpmsD5nBTr+69Kki/ZA569IW3Fi+0gJER0uIKmqxKvYqFycYcPiJdYKIl44JsRdMQ4TppL4mDWVu41Mqk7RwbgOOD+Y2OMfX88eBHE8Nkyb9kBML6PDUk5z0D0RQMSf7n8s2nLOf2aIiDhRB9LgX/ROxU9wmD0KU42bo1HEVESnlrXH+LuNS+HmyR22LKbFfzJbeyzWGSfCAAAAAElFTkSuQmCC) 2x) 0 0, copy;
}

.surface:focus-visible {
	outline: 2px solid #9e78ff;
	outline-offset: 3px;
}

.site {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: clamp(6px, 2cqw, 20px);
	padding: clamp(10px, 3.6cqw, 34px) clamp(12px, 4.6cqw, 44px);
	color: #26231f;
	pointer-events: none;
}

.site-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.45em;
	font-size: clamp(11px, 1.75cqw, 16px);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.brand i {
	width: 0.95em;
	height: 0.95em;
	border: 0.2em solid currentColor;
	border-radius: 50%;
}

.links {
	display: flex;
	gap: 2.6cqw;
	font-size: clamp(11px, 1.45cqw, 13.5px);
	color: #6b665e;
}

.hero {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: 1.08fr 0.92fr;
	gap: clamp(10px, 4cqw, 40px);
}

.copy {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: clamp(7px, 1.9cqw, 18px);
	min-width: 0;
	padding-bottom: 9cqh;
}

.site h1 {
	margin: 0;
	font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
	font-weight: 400;
	font-size: clamp(20px, 6.1cqw, 58px);
	line-height: 0.98;
	letter-spacing: -0.015em;
}

.site p {
	margin: 0;
	max-width: 34ch;
	font-size: clamp(11px, 1.7cqw, 16px);
	line-height: 1.5;
	color: #6b665e;
}

.cta {
	display: flex;
	align-items: center;
	gap: 1.3em;
	font-size: clamp(11px, 1.5cqw, 14px);
	font-weight: 500;
}

.site-btn {
	padding: 0.62em 1.15em;
	border-radius: 999px;
	background: #26231f;
	color: #fbfaf7;
	white-space: nowrap;
}

.more {
	text-decoration: underline;
	text-decoration-color: #c9c2b6;
	text-underline-offset: 0.3em;
	white-space: nowrap;
}

.shot {
	min-height: 0;
	overflow: hidden;
	border-radius: clamp(6px, 1.5cqw, 14px);
	background: #e9e3d8;
}

.shot svg {
	display: block;
	width: 100%;
	height: 100%;
}

@container (max-width: 480px) {
	.links,
	.site p,
	.more {
		display: none;
	}
}

/* ---------- Pins (css.ts) ---------- */

.pins {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.markdrop-thread-pin {
	position: absolute;
	height: 1.75rem;
	width: 1.75rem;
	min-width: 1.75rem;
	min-height: 1.75rem;
	padding: 0;
	background: var(--pin);
	cursor: pointer;
	transform: translate(-50%, -50%) scale(var(--s, 1));
	transform-origin: center center;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1.25rem;
	font-family: 'Inter', sans-serif;
	border-radius: 2.5rem 2.5rem 2.5rem 0.25rem;
	border: 1px solid #fff;
	font-size: max(11px, 0.75rem);
	font-weight: 600;
	color: #fff;
	text-align: center;
	outline: none;
	box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.2);
	transition:
		transform 0.2s,
		background-color 0.2s,
		box-shadow 0.2s,
		opacity 0.3s;
	pointer-events: auto;
	-webkit-tap-highlight-color: transparent;
}

.markdrop-thread-pin-content {
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.pin-hovered {
	--s: 1.1;
	box-shadow:
		0px 0px 0px 2px var(--pin),
		0px 3px 8px 0px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) {
	.markdrop-thread-pin:hover {
		--s: 1.1;
		box-shadow:
			0px 0px 0px 2px var(--pin),
			0px 3px 8px 0px rgba(0, 0, 0, 0.2);
	}
}

.markdrop-thread-pin:focus-visible {
	--s: 1.1;
	box-shadow:
		0px 0px 0px 2px var(--pin),
		0px 0px 0px 4px #fff,
		0px 3px 8px 0px rgba(0, 0, 0, 0.2);
}

.markdrop-thread-pin.is-dropping {
	--s: 0.714;
}

.markdrop-thread-pin--resolved {
	background: #10b981;
	opacity: 0;
	pointer-events: none;
}

.markdrop-thread-pin.is-leaving {
	opacity: 0;
	pointer-events: none;
}

.markdrop-pulse-dot {
	position: absolute;
	height: 1.25rem;
	width: 1.25rem;
	background: var(--pin);
	transform: translate(-50%, -50%);
	border-radius: 2.5rem;
	border: 2px solid #fff;
	box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.2);
	animation: pulse-dot 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.3s;
}

.markdrop-pulse-dot--complete {
	animation: none;
	border-radius: 2.5rem 2.5rem 2.5rem 0.25rem;
}

.markdrop-pulse-dot.is-leaving {
	opacity: 0;
}

.markdrop-pin-spinner {
	width: 0.75rem;
	height: 0.75rem;
	animation: spin 1s linear infinite;
	color: white;
}

.markdrop-pin-number {
	color: white;
	font-size: max(11px, 0.875rem);
	font-weight: 600;
	font-family: 'Inter', sans-serif;
	line-height: 1;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

@keyframes pulse-dot {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
		box-shadow: 0 0 0 0 rgba(9, 65, 255, 0.4);
	}
	50% {
		transform: translate(-50%, -50%) scale(1.2);
		opacity: 0.8;
		box-shadow: 0 0 0 10px rgba(9, 65, 255, 0);
	}
	100% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
		box-shadow: 0 0 0 0 rgba(9, 65, 255, 0);
	}
}

/* ---------- Buttons (ui/button/button.svelte) ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0;
	border: none;
	background: none;
	border-radius: var(--radius);
	font-size: 0.8125rem;
	line-height: 1.25rem;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition:
		color 0.15s,
		background-color 0.15s,
		transform 0.12s;
	-webkit-tap-highlight-color: transparent;
}

.btn svg {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	pointer-events: none;
}

.btn:focus-visible,
.head-btn:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 2px #fff,
		0 0 0 3px var(--primary);
}

.btn:disabled {
	pointer-events: none;
	opacity: 0.5;
}

.btn-square {
	height: 2rem;
	width: 2rem;
}

.btn-ghost svg {
	opacity: 0.5;
	transition: opacity 0.15s;
}

.btn-ghost:hover {
	background: var(--accent);
}

.btn-ghost:hover svg {
	opacity: 1;
}

.btn-primary {
	background: var(--primary);
	color: var(--primary-foreground);
	box-shadow: 0 12px 17px 0 rgba(76, 0, 170, 0.24);
}

.btn-primary:hover {
	background: color-mix(in oklab, var(--primary) 90%, transparent);
}

.btn-primary:focus-visible {
	box-shadow:
		0 0 0 2px #fff,
		0 0 0 3px var(--primary),
		0 12px 17px 0 rgba(76, 0, 170, 0.24);
}

.btn-sm {
	border-radius: calc(var(--radius) - 2px);
}

.btn.is-pressed {
	transform: scale(0.92);
}

/* ---------- New comment form ---------- */

.comment-form {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 30;
	width: min(20rem, 66vw);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	overflow: clip;
	border-radius: var(--radius);
	background: #fff;
	box-shadow:
		0 10px 15px -3px rgb(0 0 0 / 0.1),
		0 4px 6px -4px rgb(0 0 0 / 0.1);
	transform-origin: top left;
	animation: popup 0.2s ease-out;
}

.comment-form form {
	display: flex;
	flex-direction: column;
	margin: 0;
}

@keyframes popup {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(-10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* Editor.svelte: .editor-container and .ProseMirror */
.editor-container {
	width: 100%;
	border: 1px solid var(--gray-200);
	background: #fff;
	padding: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.25rem;
	transition: border-color 0.15s;
}

.editor-container:focus-within,
.is-scripted .editor-container {
	border-color: var(--primary-500);
}

.editor-input {
	display: block;
	width: 100%;
	min-height: 2.5rem;
	max-height: 6.25rem;
	padding: 0;
	border: 0;
	outline: none;
	resize: none;
	overflow-y: auto;
	background: transparent;
	font-size: inherit;
	line-height: inherit;
	color: var(--foreground);
	border-radius: 0;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	scrollbar-width: thin;
}

.editor-input::placeholder {
	color: var(--gray-400);
	opacity: 1;
}

.editor-ghost {
	display: none;
	min-height: 2.5rem;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	color: var(--foreground);
}

.is-scripted .editor-input {
	display: none;
}

.is-scripted .editor-ghost {
	display: block;
}

.ghost-placeholder {
	display: none;
	color: var(--gray-400);
}

.ghost-text:empty ~ .ghost-placeholder {
	display: inline;
}

.caret {
	display: inline-block;
	width: 1px;
	height: 1.1em;
	margin: 0 -0.5px;
	vertical-align: text-bottom;
	background: var(--foreground);
	animation: blink 1.06s steps(1) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

.form-actions {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem;
}

.form-tools {
	display: flex;
	align-items: center;
}

/* ---------- Thread preview from a pin ---------- */

.markdrop-message-hover {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 30;
	width: min(21.25rem, 70vw);
	display: flex;
	flex-direction: column;
	border-radius: calc(var(--radius) - 4px);
	border: 1px solid var(--border-light);
	background: #fff;
	box-shadow:
		0 4px 6px -1px rgb(0 0 0 / 0.1),
		0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.preview-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	border-bottom: 1px solid var(--border-light);
	padding: 0.5rem;
}

.preview-title {
	font-size: 0.8125rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: var(--neutral-700);
}

.preview-head-actions {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 0.125rem;
}

.head-btn {
	display: flex;
	height: 1.5rem;
	width: 1.5rem;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0.25rem;
	background: none;
	color: var(--foreground);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.head-btn svg {
	width: 1rem;
	height: 1rem;
}

.head-btn:hover {
	background: var(--neutral-100);
}

.head-btn--resolve {
	color: var(--green-600);
}

.head-btn--resolve:hover {
	background: var(--green-50);
}

.preview-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.5rem;
}

.preview-messages {
	display: flex;
	max-height: 15rem;
	flex-direction: column;
	gap: 0.5rem;
	overflow-y: auto;
	scrollbar-width: thin;
}

.msg {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.25rem;
}

.msg-avatar {
	display: flex;
	height: 1.5rem;
	width: 1.5rem;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	border-radius: 9999px;
	background: #e3d3ff;
	color: #3c0188;
	font-size: max(11px, 0.6875rem);
	font-weight: 600;
	line-height: 1;
}

.msg-main {
	display: flex;
	width: 100%;
	min-width: 0;
	flex-direction: column;
	gap: 0.25rem;
}

.msg-meta {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.msg-name {
	color: #5d5d5d;
}

.msg-badge {
	border-radius: 0.25rem;
	background: var(--neutral-200);
	padding: 0.125rem 0.25rem;
	font-size: max(11px, 0.625rem);
	line-height: 1.2;
	color: var(--neutral-600);
}

.msg-time {
	font-size: var(--xs);
	line-height: 1rem;
	color: #929292;
}

.msg-text {
	font-size: 0.875rem;
	line-height: 1.5rem;
	color: var(--gray-700);
	overflow-wrap: break-word;
}

.preview-count {
	margin-left: 2rem;
	font-size: var(--xs);
	line-height: 1rem;
	color: var(--muted-foreground);
}

.reply-form {
	display: flex;
	width: 100%;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	border-radius: calc(var(--radius) - 2px);
	background: var(--neutral-100);
	padding: 0.5rem;
}

.reply-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
}

.btn-reply {
	height: 1.5rem;
	padding: 0 0.5rem;
	border-radius: calc(var(--radius) - 2px);
	font-size: var(--xs);
	line-height: 1rem;
}

/* Small tile: keep the comment, drop the secondary parts */
@media (max-height: 330px), (max-width: 480px) {
	.reply-form,
	.preview-count,
	.msg-badge {
		display: none;
	}
}

/* ---------- Drawn cursor for the idle loop ---------- */

.demo-cursor {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 50;
	width: 1.5rem;
	height: 1.5rem;
	pointer-events: none;
	opacity: 0;
}

.demo-cursor i {
	display: block;
	width: 100%;
	height: 100%;
	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAD4UlEQVR4AdVasVLbQBBdKdSZfEAyKDUF0AWayBUlNNAiz9DH+AdsfsCQnoxNCwVQUtk0gQ6noEZM6OOhBin7JJ3n7izbkmXZ8ptZyXc62fdu92739mz4vu8Q0XfKH88sPZauYRgdmhaYQMufD9oYPBaLMsCk+cFmabI8MYnmpEQMaIDv+yictzy6v/UpD3y2DFpZNfhOtLJmDGvWYjliE3MpIZbkwv0tSORDgI21/+mLRbRhm7S7b/BdIeOw7PCggsQJJcBcTOivG2p7t/ROG1/f6PzMkx9/YjmOzOrTuO+a5xwIADJVxwuIvLjKI4flYdzcmDsBARD5xiQaR4o2LJb2KBKFISDQqHtUP4wlEWtOhSMAnJ54VC0PkGjGtS0kAQCTXNMEVqeK3q6wBABo4vSnQqKmz4dcCRz8MAPJgnrFo8du34dgHiimlBsBOKj6iRnICM+bCJop2awFWxRmYkIfx7qj0bjr+HRzpUQINfGh0HNAhjYXbLGsLgwBaAEiwcFlYQgAN9cKgW1cFooAfIOENZjRQhF45Q3pi6ssqdZCEQB+qxuutYUjoIXc1hJNADimcWu77LySODKYh+Rxh0IyIWA5NYGDCnvX43SKS9oeHhfxTxqkNqGsXnXaSK0BbDg0hxILmI0YeYzsOPNIakI6QMAVBaQ8kiAJARnoWNp3hgHpGQnPGCK3/3A5W9Q4C6ysKsUeCHRFadMuPgFNA12hgV74sHiTVAYSYvKSjCSxyZcgYywq95zi+jZk8yR0cBE116J2a7u4ZoRUpIQzXASBlqjFVnCjgHMhzKcq/ergEhCIzKgjnmTdiOeBw5rSp5bIYMu1R+LD1k52Lbz2ppflxuhrc7PfV6WXODWh8OAhcD5b6++UBdV6+KPw3llw/7QkO1mMflkUdAJo9kDhZiEIrLSUxsxRZdMRA0Hhcr8uH4Aoeoke9NWDyBMyL2AuSp0HBk5vYg2dNXHJtx1RRv5eO4TIHXv7JjVaAxO3rLcbRgAmBFOyRN0ksfqkwMgjoyfBpdB0enrbWPuIGpZICvQQGldr+ZsTfiem86W4zgMj18poUmNlskQd9qS7pbfgRGWaCHKpxx841lGqXQo77w57b+SQRi+uU+S2ASxnd7ysNZpmsD5nBTr+69Kki/ZA569IW3Fi+0gJER0uIKmqxKvYqFycYcPiJdYKIl44JsRdMQ4TppL4mDWVu41Mqk7RwbgOOD+Y2OMfX88eBHE8Nkyb9kBML6PDUk5z0D0RQMSf7n8s2nLOf2aIiDhRB9LgX/ROxU9wmD0KU42bo1HEVESnlrXH+LuNS+HmyR22LKbFfzJbeyzWGSfCAAAAAElFTkSuQmCC) 0 0 / 100% 100% no-repeat;
	transform-origin: 0 0;
	transition: transform 0.12s;
}

.demo-cursor.is-down i {
	transform: scale(0.84);
}

.demo-cursor.is-arrow i {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 2v17l4.6-4.2 3 6.7 2.9-1.3-3-6.6 6.3-.3z' fill='%23111' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
	.markdrop-pulse-dot,
	.caret,
	.comment-form {
		animation: none;
	}

	.markdrop-thread-pin,
	.markdrop-pulse-dot,
	.btn {
		transition: none;
	}
}
