.site-markdown-editor {
	--site-editor-accent: #8c6cff;
	--site-editor-cyan: #41cfff;
	position: relative;
	display: flex;
	width: 100%;
	height: fit-content;
	min-height: 0;
	min-width: 0;
	overflow: visible;
	flex-direction: column;
	container-name: site-markdown-editor;
	container-type: inline-size;
	border: 1px solid rgba(140, 108, 255, .32);
	color: #c8d0df;
	background: rgba(5, 8, 20, .48);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 18px 44px rgba(0, 0, 0, .2);
	text-transform: none;
	transition: border-color 180ms ease, box-shadow 180ms ease;
}

.site-markdown-editor:hover {
	border-color: rgba(140, 108, 255, .46);
}

.site-markdown-editor:focus-within {
	border-color: rgba(140, 108, 255, .7);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 0 19px rgba(140, 108, 255, .09), 0 20px 46px rgba(0, 0, 0, .22);
}

.site-markdown-editor__history {
	display: flex;
	align-items: stretch;
}

.site-markdown-editor__history button {
	display: grid;
	width: 46px;
	height: 46px;
	min-width: 46px;
	min-height: 46px;
	padding: 0;
	border: 0;
	border-left: 1px solid rgba(126, 144, 222, .13);
	border-radius: 0;
	place-items: center;
	color: #8792a9;
	background: transparent;
	cursor: pointer;
	transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.site-markdown-editor__history button svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.75;
}

.site-markdown-editor__history button:hover:not(:disabled),
.site-markdown-editor__history button:focus-visible:not(:disabled) {
	color: #e2dcff;
	background: rgba(140, 108, 255, .08);
	box-shadow: inset 0 -2px 0 rgba(140, 108, 255, .72);
	outline: none;
}

.site-markdown-editor__history button:disabled {
	color: #3c4559;
	cursor: default;
}

.site-markdown-editor__toolbar {
	position: relative;
	z-index: 5;
	display: flex;
	min-width: 0;
	min-height: 45px;
	flex: 0 0 auto;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	overflow: visible;
	padding: 5px 8px;
	border-bottom: 1px solid rgba(126, 144, 222, .13);
	background: rgba(7, 10, 23, .65);
}

.site-markdown-editor__tools {
	display: contents;
}

.site-markdown-editor__format-control {
	position: relative;
	z-index: 2;
	width: 148px;
	height: 32px;
	flex: 0 0 auto;
}

.site-markdown-editor__format {
	width: 100%;
	height: 32px;
}

.site-markdown-editor__format .site-dropdown__trigger {
	height: 32px;
	min-height: 32px;
	padding: 0 9px 0 11px;
	border-color: rgba(126, 144, 222, .18);
	background: rgba(5, 8, 20, .3);
}

.site-markdown-editor__format .site-dropdown__copy strong {
	font-size: 11px;
	line-height: 1;
}

.site-markdown-editor__format .site-dropdown__trigger > svg {
	width: 14px;
	height: 14px;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.75;
}

.site-markdown-editor__format .site-dropdown__surface {
	max-height: 180px;
}

.site-markdown-editor__format .site-dropdown__option {
	min-height: 32px;
	padding-right: 10px;
	padding-left: 12px;
	font-size: 11px;
}

.site-markdown-editor__tool-group {
	display: flex;
	align-items: center;
	gap: 2px;
	padding-right: 5px;
	margin-right: 1px;
	border-right: 1px solid rgba(126, 144, 222, .12);
}

.site-markdown-editor__tool-group > button,
.site-markdown-editor__toolbar .site-markdown-editor__clear {
	display: grid;
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	flex: 0 0 auto;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 0;
	place-items: center;
	color: #7f8aa1;
	background: transparent;
	font: 400 12px/1 "JetBrainsMono", "JetBrains Mono", Consolas, monospace;
	cursor: pointer;
	transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.site-markdown-editor__tool-group > button:hover,
.site-markdown-editor__tool-group > button:focus-visible,
.site-markdown-editor__tool-group > button.is-active,
.site-markdown-editor__toolbar .site-markdown-editor__clear:hover,
.site-markdown-editor__toolbar .site-markdown-editor__clear:focus-visible,
.site-markdown-editor__toolbar .site-markdown-editor__clear.is-active {
	border-color: rgba(140, 108, 255, .34);
	color: #ded8ff;
	background: rgba(140, 108, 255, .085);
	box-shadow: 0 0 10px rgba(140, 108, 255, .055);
	outline: none;
}

.site-markdown-editor__tool-group > button:active,
.site-markdown-editor__toolbar .site-markdown-editor__clear:active {
	border-color: rgba(140, 108, 255, .64);
	background: rgba(140, 108, 255, .15);
}

.site-markdown-editor__tool-group > button > svg,
.site-markdown-editor__toolbar .site-markdown-editor__clear > svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.75;
}
.site-markdown-editor__clear { margin-left: auto; }

.site-markdown-editor__surface {
	min-width: 0;
	min-height: var(--site-markdown-editor-height, 420px);
	max-height: min(58vh, 650px);
	flex: 0 1 auto;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 32px 38px 40px;
	border: 0;
	outline: none;
	color: #c2cad9;
	background: linear-gradient(120deg, rgba(6, 11, 25, .86), rgba(10, 9, 27, .91));
	font: 400 14px/1.78 "GothamPro", "Gotham Pro", "Montserrat", "Segoe UI", sans-serif;
	caret-color: #f2efff;
	text-transform: none;
	scrollbar-color: rgba(140, 108, 255, .48) rgba(5, 8, 20, .28);
	scrollbar-width: thin;
}

.site-markdown-editor__surface:empty::before {
	color: #505b72;
	content: attr(data-placeholder);
	pointer-events: none;
}

.site-markdown-editor__surface::selection,
.site-markdown-editor__surface *::selection {
	color: #fff;
	background: rgba(140, 108, 255, .34);
}

.site-markdown-editor__surface > :first-child { margin-top: 0 !important; }
.site-markdown-editor__surface > :last-child { margin-bottom: 0 !important; }

.site-markdown-editor__surface :is(h1, h2, h3, h4, h5, h6) {
	margin: 1.55em 0 .65em;
	color: #eef0f8;
	font-weight: 400;
	line-height: 1.35;
}

.site-markdown-editor__surface h1 { font-size: 27px; }
.site-markdown-editor__surface h2 { font-size: 22px; }
.site-markdown-editor__surface h3 { font-size: 18px; }
.site-markdown-editor__surface h4 { font-size: 16px; }
.site-markdown-editor__surface :is(h5, h6) { font-size: 14px; }
.site-markdown-editor__surface p { margin: 0 0 15px; }
.site-markdown-editor__surface :is(strong, b) { color: #e8ebf4; font-weight: 500; }
.site-markdown-editor__surface.is-native-bold-command :is(strong, b) { font-weight: 700; }
.site-markdown-editor__surface em { color: #abb5ca; }
.site-markdown-editor__surface del { color: #7b879e; }

.site-markdown-editor__surface a {
	color: #a68fff;
	text-decoration: underline;
	text-decoration-color: rgba(166, 143, 255, .38);
	text-underline-offset: 3px;
	cursor: text;
}

.site-markdown-editor__surface :is(ul, ol) {
	display: grid;
	gap: 8px;
	margin: 16px 0 20px;
	padding-left: 25px;
}

.site-markdown-editor__surface li::marker { color: #9c86fb; }
.site-markdown-editor__surface .task-list-item { list-style: none; }

.site-markdown-editor__surface input[type="checkbox"] {
	width: 14px;
	height: 14px;
	margin: 0 8px 0 -21px;
	accent-color: var(--site-editor-accent);
	vertical-align: -2px;
}

.site-markdown-editor__surface blockquote {
	margin: 20px 0;
	padding: 14px 17px;
	border: 1px solid rgba(140, 108, 255, .2);
	border-left: 2px solid var(--site-editor-accent);
	background: rgba(140, 108, 255, .055);
	box-shadow: -5px 0 14px rgba(140, 108, 255, .055);
}

.site-markdown-editor__surface blockquote > :last-child { margin-bottom: 0; }

.site-markdown-editor__surface hr {
	height: 1px;
	margin: 27px 0;
	border: 0;
	background: linear-gradient(90deg, transparent, rgba(126, 144, 222, .32), transparent);
}

.site-markdown-editor__surface :is(code, kbd) {
	padding: 2px 6px;
	border: 1px solid rgba(140, 108, 255, .2);
	border-radius: 3px;
	color: #c2b5ff;
	background: rgba(140, 108, 255, .06);
	font: 400 12px/1.5 "JetBrainsMono", "JetBrains Mono", Consolas, monospace;
}

.site-markdown-editor__surface pre {
	overflow: auto;
	margin: 20px 0;
	padding: 16px 18px;
	border: 1px solid rgba(126, 144, 222, .17);
	background: rgba(3, 6, 16, .68);
}

.site-markdown-editor__surface pre code {
	padding: 0;
	border: 0;
	border-radius: 0;
	color: #c9d2e5;
	background: transparent;
}

.site-markdown-editor__surface table {
	width: 100%;
	margin: 21px 0;
	border: 1px solid rgba(126, 144, 222, .18);
	border-collapse: collapse;
}

.site-markdown-editor__surface :is(th, td) {
	min-width: 90px;
	padding: 10px 12px;
	border-right: 1px solid rgba(126, 144, 222, .13);
	border-bottom: 1px solid rgba(126, 144, 222, .13);
	font-size: 13px;
	text-align: left;
	vertical-align: top;
}

.site-markdown-editor__surface th {
	color: #dce1ee;
	background: rgba(140, 108, 255, .05);
	font-weight: 400;
}

.site-markdown-editor__surface img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 20px auto;
	border: 1px solid rgba(126, 144, 222, .18);
}

.site-markdown-editor__surface .site-rich-video {
	width: 100%;
	margin: 20px auto;
}

.site-markdown-editor__surface .site-rich-video iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 1px solid rgba(140, 108, 255, .24);
	background: #030610;
}

.site-markdown-editor__insert-panel {
	position: absolute;
	top: 46px;
	right: 8px;
	z-index: 6;
	display: grid;
	width: min(390px, calc(100% - 16px));
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 8px;
	padding: 11px;
	border: 1px solid rgba(140, 108, 255, .42);
	background: rgba(7, 10, 24, .78);
	box-shadow: 0 20px 46px rgba(0, 0, 0, .38), 0 0 20px rgba(140, 108, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .035);
	backdrop-filter: blur(18px) saturate(130%);
	-webkit-backdrop-filter: blur(18px) saturate(130%);
}

.site-markdown-editor__insert-panel[hidden] { display: none !important; }

.site-markdown-editor__insert-panel label {
	display: grid;
	gap: 6px;
	min-width: 0;
	color: #808ca4;
	font: 400 10px/1 "GothamPro", "Gotham Pro", sans-serif;
	letter-spacing: .055em;
	text-transform: uppercase;
}

.site-markdown-editor__insert-panel input {
	width: 100%;
	height: 36px;
	min-height: 36px;
	padding: 0 10px;
	border: 1px solid rgba(126, 144, 222, .24);
	border-radius: 0;
	outline: none;
	color: #e2e6f1;
	background: rgba(3, 6, 16, .6);
	font: 400 12px/1 "GothamPro", "Gotham Pro", sans-serif;
	text-transform: none;
}

.site-markdown-editor__insert-panel input:focus {
	border-color: rgba(65, 207, 255, .58);
	box-shadow: inset 2px 0 0 rgba(65, 207, 255, .72);
}

.site-markdown-editor__insert-panel > div {
	display: flex;
	gap: 5px;
}

.site-markdown-editor__insert-panel button {
	display: grid;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	padding: 0;
	border: 1px solid rgba(126, 144, 222, .24);
	border-radius: 0;
	place-items: center;
	color: #98a3ba;
	background: rgba(5, 8, 20, .62);
	cursor: pointer;
}

.site-markdown-editor__insert-panel button[hidden] {
	display: none !important;
}

.site-markdown-editor__insert-panel button:last-child {
	border-color: rgba(140, 108, 255, .44);
	color: #c4b8fa;
}

.site-markdown-editor__insert-panel .site-markdown-editor__insert-remove {
	border-color: rgba(255, 78, 98, .34);
	color: #ff8290;
	background: rgba(89, 13, 28, .22);
}

.site-markdown-editor__insert-panel .site-markdown-editor__insert-remove:hover,
.site-markdown-editor__insert-panel .site-markdown-editor__insert-remove:focus-visible {
	border-color: rgba(255, 78, 98, .68);
	color: #ffd5d9;
	background: rgba(255, 78, 98, .12);
}

.site-markdown-editor__insert-panel button:hover,
.site-markdown-editor__insert-panel button:focus-visible {
	border-color: rgba(140, 108, 255, .7);
	color: #fff;
	background: rgba(140, 108, 255, .12);
	outline: none;
}

.site-markdown-editor__insert-panel button svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.site-markdown-editor__status {
	display: flex;
	height: 35px;
	min-width: 0;
	min-height: 35px;
	flex: 0 0 35px;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 0 0 13px;
	border-top: 1px solid rgba(126, 144, 222, .13);
	color: #59657c;
	background: rgba(7, 10, 23, .68);
	font: 400 10px/1 "GothamPro", "Gotham Pro", sans-serif;
	letter-spacing: .025em;
}

.site-markdown-editor__status > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.site-markdown-editor__status .site-markdown-editor__history button {
	width: 34px;
	height: 34px;
	min-width: 34px;
	min-height: 34px;
}

.site-markdown-editor__status .site-markdown-editor__history button svg {
	width: 16px;
	height: 16px;
}

.site-markdown-editor__visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@container site-markdown-editor (max-width: 760px) {
	.site-markdown-editor__toolbar {
		flex-wrap: nowrap;
	}

	.site-markdown-editor__tools {
		display: flex;
		min-width: 0;
		flex: 1 1 auto;
		align-items: center;
		align-self: stretch;
		gap: 4px;
		overflow-x: auto;
		overflow-y: hidden;
		scrollbar-width: none;
	}

	.site-markdown-editor__tools::-webkit-scrollbar {
		display: none;
	}

	.site-markdown-editor__tool-group {
		flex: 0 0 auto;
	}

	.site-markdown-editor__clear {
		flex: 0 0 auto;
	}
}

@container site-markdown-editor (max-width: 500px) {
	.site-markdown-editor__format-control {
		width: 132px;
	}

	.site-markdown-editor__insert-panel {
		grid-template-columns: minmax(0, 1fr);
		align-items: stretch;
	}

	.site-markdown-editor__insert-panel > div {
		justify-content: flex-end;
	}
}

.site-markdown-editor--compact .site-markdown-editor__surface {
	padding: 22px 28px 26px;
}

@media (max-width: 720px) {
	.site-markdown-editor__surface {
		padding: 25px 23px 32px;
	}

	.site-markdown-editor--compact .site-markdown-editor__surface {
		padding: 20px 20px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-markdown-editor,
	.site-markdown-editor * {
		transition-duration: .01ms !important;
	}
}
