/* MagicKit - Code Block */
.mk-code {
	--mk-code-bg: #0f172a;
	--mk-code-bar: rgba(255, 255, 255, 0.04);
	--mk-code-text: #e2e8f0;
	--mk-code-muted: #64748b;
	--mk-code-kw: #c084fc;
	--mk-code-str: #86efac;
	--mk-code-num: #fbbf24;
	--mk-code-com: #64748b;
	--mk-code-fn: #60a5fa;
	--mk-code-tag: #f472b6;
	--mk-code-attr: #fcd34d;
	--mk-code-hl: rgba(123, 47, 247, 0.22);
	border-radius: var(--mk-radius);
	background: var(--mk-code-bg);
	color: var(--mk-code-text);
	overflow: hidden;
	box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.5);
}

.mk-code-theme-light .mk-code {
	--mk-code-bg: #f8fafc;
	--mk-code-bar: #eef2f7;
	--mk-code-text: #1e293b;
	--mk-code-kw: #7c3aed;
	--mk-code-str: #15803d;
	--mk-code-num: #b45309;
	--mk-code-com: #94a3b8;
	--mk-code-fn: #2563eb;
	--mk-code-tag: #db2777;
	--mk-code-attr: #a16207;
	--mk-code-hl: rgba(123, 47, 247, 0.1);
	border: 1px solid var(--mk-border);
	box-shadow: none;
}

.mk-code-theme-brand .mk-code {
	--mk-code-bg: color-mix(in srgb, var(--mk-dark) 92%, var(--mk-primary));
}

.mk-code__bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px;
	background: var(--mk-code-bar);
	font-size: 13px;
}

.mk-code__dots {
	display: inline-flex;
	gap: 6px;
}

.mk-code__dots i {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #ef4444;
}

.mk-code__dots i:nth-child(2) { background: #f59e0b; }
.mk-code__dots i:nth-child(3) { background: #22c55e; }

.mk-code__name {
	flex: 1;
	color: var(--mk-code-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mk-code__copy {
	padding: 4px 12px;
	border: 1px solid color-mix(in srgb, var(--mk-code-text) 20%, transparent);
	border-radius: 8px;
	background: transparent;
	color: var(--mk-code-text);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.mk-code__copy.is-copied {
	border-color: #22c55e;
	color: #22c55e;
}

.mk-code__pre {
	margin: 0;
	padding: 18px 0;
	background: transparent;
	color: inherit;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px;
	line-height: 1.65;
	overflow: auto;
	tab-size: 4;
	counter-reset: mk-line;
}

.mk-code__pre code {
	display: block;
	min-width: max-content;
	background: none;
	color: inherit;
	font: inherit;
}

.mk-code-wrap-yes .mk-code__pre code {
	min-width: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.mk-code__line {
	display: block;
	padding: 0 20px;
}

.mk-code__pre.has-lines .mk-code__line {
	padding-left: 64px;
	position: relative;
}

.mk-code__pre.has-lines .mk-code__line::before {
	counter-increment: mk-line;
	content: counter(mk-line);
	position: absolute;
	left: 0;
	width: 44px;
	color: var(--mk-code-muted);
	text-align: right;
	user-select: none;
}

.mk-code__line.is-hl {
	background: var(--mk-code-hl);
	box-shadow: inset 3px 0 0 var(--mk-primary);
}

.mk-tok-kw { color: var(--mk-code-kw); }
.mk-tok-str { color: var(--mk-code-str); }
.mk-tok-num { color: var(--mk-code-num); }
.mk-tok-com { color: var(--mk-code-com); font-style: italic; }
.mk-tok-fn { color: var(--mk-code-fn); }
.mk-tok-tag { color: var(--mk-code-tag); }
.mk-tok-attr { color: var(--mk-code-attr); }
.mk-tok-var { color: var(--mk-code-attr); }
