/* Блок «Запуск кода» — стилистика сайта: шрифт Onest, акцент #01A97D. */

.code-run {
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	border: 1px solid #e9e9e9;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	margin: 1rem 0;
}

/* Блок с активной подсветкой прилипает к верху при прокрутке, не заезжая
   под фиксированную шапку сайта (высота шапки задаётся через CSS-переменную
   --code-run-sticky-top из run.js). */
.code-run.code-run--highlight {
	position: sticky;
	top: var(--code-run-sticky-top, 84px);
	z-index: 5;
}

.code-run__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #fafafa;
	border-bottom: 1px solid #e9e9e9;
}

.code-run__lang {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6b7280;
}

.code-run__run {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.45em 1em;
	border: 1px solid transparent;
	border-radius: 8px;
	background: #01a97d;
	color: #fff;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.code-run__run:hover {
	background: #029f76;
}

.code-run__run:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ---------- Редактор с подсветкой поверх textarea ---------- */

.code-run__editor-wrap {
	position: relative;
	--code-run-gutter: 44px;
}

.code-run__highlight,
.code-run__editor {
	margin: 0;
	border: 0;
	padding: 1rem 1.25rem;
	padding-left: calc(var(--code-run-gutter) + 1.25rem);
	box-sizing: border-box;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Roboto Mono", monospace;
	font-size: 13px;
	line-height: 1.55;
	tab-size: 4;
	white-space: pre;
	overflow-wrap: normal;
	word-break: normal;
	text-align: left;
}

.code-run__gutter {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--code-run-gutter);
	overflow: hidden;
	padding: 1rem 0;
	box-sizing: border-box;
	text-align: right;
	background: #fafafa;
	border-right: 1px solid #e9e9e9;
	color: #9ca3af;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Roboto Mono", monospace;
	font-size: 13px;
	line-height: 1.55;
	user-select: none;
	pointer-events: none;
}

.code-run__gutter-line {
	display: block;
	min-height: 1.55em;
	padding-right: 10px;
}

.code-run__highlight {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	overflow: hidden;
	pointer-events: none;
	color: #1e1e1e;
	background: #fff;
}

.code-run__code {
	font: inherit;
}

.code-run__editor {
	position: relative;
	display: block;
	width: 100%;
	min-height: 180px;
	resize: vertical;
	background: transparent;
	color: #1e1e1e;
	caret-color: #01a97d;
	overflow-y: auto;
	overflow-x: auto;
}

.code-run__editor:focus {
	outline: none;
}

/* Текст textarea прозрачен — виден только подсвеченный слой под ним. */
.code-run--highlight .code-run__editor {
	color: transparent;
	-webkit-text-fill-color: transparent;
	caret-color: #01a97d;
}

.code-run--highlight .code-run__editor::selection {
	background: rgba(1, 169, 125, 0.2);
}

/* ---------- Плашка «Развернуть/Свернуть» под редактором ---------- */

.code-run__editor-toggle {
	display: flex;
	justify-content: center;
	padding: 0.5rem;
	background: #fafafa;
	border-top: 1px solid #e9e9e9;
}

.code-run__expand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.9rem;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	background: #fff;
	color: #475569;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.code-run__expand:hover {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #0f172a;
}

.code-run__expand-icon {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.2s ease;
}

.code-run__expand.is-expanded .code-run__expand-icon {
	transform: rotate(180deg);
}

/* ---------- Токены подсветки Go (Prism) ---------- */

.code-run .token.comment,
.code-run .token.prolog,
.code-run .token.cdata {
	color: #9ca3af;
	font-style: italic;
}

.code-run .token.keyword {
	color: #0da88c;
	font-weight: 600;
}

.code-run .token.string,
.code-run .token.char {
	color: #b45309;
}

.code-run .token.number {
	color: #1d4ed8;
}

.code-run .token.builtin {
	color: #0369a1;
}

.code-run .token.function {
	color: #0f766e;
}

.code-run .token.boolean,
.code-run .token.constant {
	color: #7c3aed;
}

.code-run .token.operator,
.code-run .token.punctuation {
	color: #374151;
}

/* ---------- Панель вывода ---------- */

.code-run__output {
	margin: 0;
	padding: 0.875rem 1.25rem;
	background: #0f172a;
	color: #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
	word-break: break-word;
	border-top: 1px solid #e9e9e9;
	max-height: 320px;
	overflow: auto;
}

.code-run__output.is-error {
	background: #1f1113;
	color: #fca5a5;
}

/* ---------- Статичный вывод программы (language = output) ---------- */

.code-run__output-body {
	margin: 0;
	padding: 0.875rem 1.25rem;
	background: #0f172a;
	color: #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
	word-break: break-word;
}

.code-run--output.is-error .code-run__output-body {
	background: #1f1113;
	color: #fca5a5;
}

/* ---------- Кнопки в тулбаре ---------- */

.code-run__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.code-run__input {
	padding: 0.45em 0.75em;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.875rem;
	color: #272a41;
	min-width: 8rem;
	transition: border-color 0.2s ease;
}

.code-run__input:focus {
	outline: none;
	border-color: #01a97d;
}

.code-run__debug {
	display: inline-flex;
	align-items: center;
	padding: 0.45em 1em;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	background: #fff;
	color: #272a41;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.code-run__debug:hover {
	background: #f5f5f5;
	border-color: #01a97d;
}

.code-run__debug:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ---------- Подсветка текущей строки ---------- */

.code-run__current-line {
	position: absolute;
	left: 0;
	right: 0;
	background: rgba(1, 169, 125, 0.14);
	border-left: 3px solid #01a97d;
	pointer-events: none;
}

/* ---------- Панель пошаговой отладки ---------- */

.code-run__debug-panel {
	border-top: 1px solid #e9e9e9;
	background: #fafafa;
	padding: 0.75rem 1rem;
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.code-run__debug-controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	row-gap: 0.25rem;
	margin-bottom: 0.5rem;
}

.code-run__debug-btn {
	width: 2rem;
	height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	background: #fff;
	color: #272a41;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

.code-run__debug-btn:hover {
	border-color: #01a97d;
}

.code-run__debug-step {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #272a41;
}

.code-run__debug-filter {
	display: inline-flex;
	align-items: center;
	padding: 0.15em 0.55em;
	border: 1px solid #d5d5d5;
	border-radius: 999px;
	background: #fff;
	color: #6b7280;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.code-run__debug-filter:hover {
	border-color: #01a97d;
	color: #01a97d;
}

.code-run__debug-filter[aria-pressed='true'] {
	background: #01a97d;
	border-color: #01a97d;
	color: #fff;
}

.code-run__explain {
	display: inline-flex;
	align-items: center;
	padding: 0.35em 0.7em;
	border: 1px solid #01a97d;
	border-radius: 8px;
	background: #fff;
	color: #01a97d;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.code-run__explain:hover {
	background: #01a97d;
	color: #fff;
}

.code-run__explain:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.code-run__debug-explain {
	margin-top: 0.5rem;
	padding: 0.625rem 0.75rem;
	background: #f0fdf8;
	border: 1px solid #d1f0e6;
	border-radius: 8px;
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 0.8125rem;
	line-height: 1.55;
	color: #1f3a33;
	white-space: pre-wrap;
	word-break: break-word;
}

.code-run__debug-vars {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	color: #6b7280;
}

.code-run__debug-group {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem 0.75rem;
}

.code-run__debug-group-title {
	font-weight: 700;
	color: #272a41;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 11px;
}

.code-run__debug-var {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4em;
	padding: 0.2em 0.6em;
	background: #fff;
	border: 1px solid #e9e9e9;
	border-radius: 6px;
}

.code-run__debug-var-name {
	color: #0f766e;
	font-weight: 600;
}

.code-run__debug-var-value {
	color: #272a41;
	max-width: 36ch;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.code-run__debug-var-value.is-expanded {
	max-width: none;
	white-space: normal;
	overflow: visible;
	word-break: break-word;
}

.code-run__debug-var-toggle {
	margin-left: auto;
	padding: 0.05em 0.55em;
	border: 1px solid #d5d5d5;
	border-radius: 999px;
	background: #fff;
	color: #6b7280;
	font-family: inherit;
	font-size: 10px;
	line-height: 1.5;
	cursor: pointer;
	flex: none;
	white-space: nowrap;
}

.code-run__debug-var-toggle:hover {
	border-color: #01a97d;
	color: #01a97d;
}

.code-run__debug-stdout {
	margin-top: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #0f172a;
	color: #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	white-space: pre-wrap;
	word-break: break-word;
	border-radius: 6px;
}

/* ---------- Индикатор загрузки ---------- */

.code-run__loading {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: #6b7280;
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 0.8125rem;
}

.code-run__spinner {
	width: 1em;
	height: 1em;
	flex: none;
	border: 2px solid #d5d5d5;
	border-top-color: #01a97d;
	border-radius: 50%;
	animation: code-run-spin 0.8s linear infinite;
}

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

/* ---------- Горутины ---------- */

.code-run__goroutine {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4em;
}

.code-run__goroutine-status {
	padding: 0 0.4em;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
}

.code-run__goroutine-status.is-running {
	background: #dcfce7;
	color: #15803d;
}

.code-run__goroutine-status.is-runnable {
	background: #fef3c7;
	color: #b45309;
}

.code-run__goroutine-status.is-syscall {
	background: #dbeafe;
	color: #1d4ed8;
}

.code-run__goroutine-status.is-waiting {
	background: #e5e7eb;
	color: #6b7280;
}

.code-run__goroutine-status.is-dead {
	background: #ffe4e6;
	color: #be123c;
}

.code-run__goroutine-status.is-idle {
	background: #f1f5f9;
	color: #94a3b8;
}

.code-run__goroutine-status.is-copystack {
	background: #ede9fe;
	color: #6d28d9;
}

.code-run__goroutine-status.is-unknown {
	background: #f3f4f6;
	color: #9ca3af;
}

.code-run__goroutine-main {
	padding: 0 0.4em;
	border-radius: 999px;
	background: #d1f0e6;
	color: #0b6b52;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
}

.code-run__goroutine-stack {
	color: #9ca3af;
	font-size: 11px;
}

.code-run__goroutine-wait {
	padding: 0 0.4em;
	border-radius: 999px;
	background: #fff1f2;
	color: #be123c;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.5;
}

/* ---------- Подсказка «Что здесь показано» ---------- */

.code-run__debug-help {
	margin-left: 0.25rem;
	font-weight: 700;
}

.code-run__debug-help--on {
	background: #01a97d;
	border-color: #01a97d;
	color: #fff;
}

.code-run__debug-legend {
	margin-bottom: 0.5rem;
	padding: 0.625rem 0.75rem;
	background: #f0fdf8;
	border: 1px solid #d1f0e6;
	border-radius: 8px;
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #1f3a33;
}

.code-run__debug-legend-title {
	margin: 0 0 0.25rem;
	font-weight: 700;
}

.code-run__debug-legend-dynamic {
	margin: 0 0 0.5rem;
	padding: 0.375rem 0.5rem;
	background: #fff;
	border-radius: 6px;
	font-size: 0.75rem;
	color: #0b6b52;
}

.code-run__debug-legend-list {
	margin: 0;
	padding-left: 1.25rem;
}

.code-run__debug-legend-list li {
	margin: 0.2rem 0;
}

.code-run__debug-legend code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.75rem;
	background: #fff;
	border-radius: 4px;
	padding: 0.05em 0.35em;
}

/* ---------- Визуализации (схемы/диаграммы) ---------- */

.code-run__viz {
	margin-top: 0.5rem;
	border: 1px solid #e9e9e9;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.code-run__viz-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	padding: 0.4rem 0.5rem;
	background: #fafafa;
	border-bottom: 1px solid #e9e9e9;
}

.code-run__viz-tab {
	display: inline-flex;
	align-items: center;
	padding: 0.3em 0.7em;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #6b7280;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.code-run__viz-tab:hover {
	background: #f0f0f0;
}

.code-run__viz-tab.is-active {
	background: #01a97d;
	color: #fff;
}

.code-run__viz-pane {
	display: none;
	padding: 0.5rem;
}

.code-run__viz-pane.is-active {
	display: block;
}

.code-run__viz-toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.5rem;
}

.code-run__viz-svg {
	display: block;
	width: 100%;
	height: auto;
	min-height: 80px;
}

.code-run__viz-axis {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 9px;
	fill: #9ca3af;
}

.code-run__viz-freed {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 10px;
	fill: #e5484d;
}

.code-run__viz-empty {
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	fill: #9ca3af;
}

.code-run__viz-pane-body {
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.code-run__viz-caption {
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #1f3a33;
	margin-bottom: 0.4rem;
}

.code-run__viz-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	margin-bottom: 0.5rem;
}

.code-run__viz-legend-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-size: 11px;
	color: #6b7280;
}

.code-run__viz-legend-dot {
	width: 9px;
	height: 9px;
	border-radius: 3px;
	display: inline-block;
	flex: none;
}

.code-run__viz-facts {
	margin-top: 0.5rem;
	padding-top: 0.4rem;
	border-top: 1px dashed #e9e9e9;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
	color: #6b7280;
}

.code-run__viz-note {
	padding: 0.75rem;
	background: #f8fafc;
	border: 1px dashed #d5d5d5;
	border-radius: 8px;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #6b7280;
}

.code-run__viz-note code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.8125rem;
	background: #fff;
	border-radius: 4px;
	padding: 0.05em 0.35em;
}

/* Схема планировщика G-M-P: вложенность P → M → G */

.code-run__sched {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
}

.code-run__sched-section {
	margin: 0.45rem 0;
}

.code-run__sched-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #6b7280;
	margin-bottom: 0.4rem;
}

.code-run__sched-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 0.6rem;
}

.code-run__sched-p {
	position: relative;
	border: 1.5px dashed #c7d2fe;
	border-radius: 10px;
	background: #f8faff;
	padding: 0.6rem;
}

.code-run__sched-p.is-idle {
	border-color: #fcd34d;
	background: #fffdf5;
}

.code-run__sched-p-tag {
	position: absolute;
	top: -8px;
	left: 10px;
	padding: 0 6px;
	background: #fff;
	font-size: 10px;
	font-weight: 800;
	color: #4338ca;
	letter-spacing: 0.06em;
	border-radius: 4px;
}

.code-run__sched-p-state {
	position: absolute;
	top: -8px;
	right: 10px;
	padding: 0 6px;
	background: #fff;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 4px;
}

.code-run__sched-p-state.is-run {
	color: #16a34a;
}

.code-run__sched-p-state.is-idle {
	color: #b45309;
}

.code-run__sched-m {
	position: relative;
	border: 1.5px solid #ddd6fe;
	border-radius: 8px;
	background: #faf8ff;
	padding: 0.5rem;
	margin-top: 0.15rem;
}

.code-run__sched-m-tag {
	position: absolute;
	top: -7px;
	left: 8px;
	padding: 0 5px;
	background: #fff;
	font-size: 9px;
	font-weight: 800;
	color: #6d28d9;
	letter-spacing: 0.06em;
	border-radius: 4px;
}

.code-run__sched-g-run {
	display: flex;
	align-items: center;
	gap: 0.4em;
	background: #16a34a;
	color: #fff;
	border-radius: 6px;
	padding: 0.4em 0.6em;
	font-weight: 700;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.code-run__sched-tri {
	font-size: 9px;
	transform: translateY(-1px);
}

.code-run__sched-g-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.code-run__sched-steal-badge {
	display: inline-block;
	padding: 0 0.4em;
	border-radius: 999px;
	background: #e11d48;
	color: #fff;
	font-size: 8px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.6;
	margin-left: 2px;
	flex: none;
}

.code-run__sched-steal-badge.is-on-run {
	background: #fff;
	color: #16a34a;
	margin-left: auto;
}

.code-run__sched-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.75rem;
	margin-bottom: 0.6rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fafafa;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
}

.code-run__sched-summary.has-steal {
	border-color: #fecdd3;
	background: #fff5f6;
}

.code-run__sched-summary-title {
	font-weight: 700;
	color: #6b7280;
}

.code-run__sched-summary.has-steal .code-run__sched-summary-title {
	color: #e11d48;
}

.code-run__sched-summary-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.code-run__sched-jump {
	display: inline-flex;
	align-items: center;
	padding: 0.15em 0.55em;
	border: 1px solid #fecdd3;
	border-radius: 999px;
	background: #fff;
	color: #e11d48;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.code-run__sched-jump:hover,
.code-run__sched-jump.is-active {
	background: #e11d48;
	border-color: #e11d48;
	color: #fff;
}

.code-run__sched-rerun {
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	padding: 0.3em 0.7em;
	border: 1px solid #01a97d;
	border-radius: 8px;
	background: #fff;
	color: #01a97d;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.code-run__sched-rerun:hover {
	background: #01a97d;
	color: #fff;
}

.code-run__sched-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 2.4rem;
	border: 1px dashed #d5d5d5;
	border-radius: 6px;
	color: #9ca3af;
	font-size: 10px;
}

.code-run__sched-lq {
	margin-top: 0.45rem;
	padding-top: 0.45rem;
	border-top: 1px solid #eef2ff;
}

.code-run__sched-lq-label {
	font-size: 9px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9ca3af;
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.code-run__sched-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.code-run__sched-empty {
	color: #9ca3af;
	font-size: 10px;
	font-style: italic;
}

.code-run__sched-bottom {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 0.6rem;
}

@media (max-width: 640px) {
	.code-run__sched-bottom {
		grid-template-columns: 1fr;
	}
}

.code-run__sched-box {
	border: 1px solid #e9e9e9;
	border-radius: 8px;
	background: #fafafa;
	padding: 0.5rem 0.6rem;
}

.code-run__sched-box-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.4rem;
}

.code-run__sched-box-h .t {
	font-size: 10px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b7280;
	font-weight: 700;
}

.code-run__sched-box-h .n {
	font-size: 10px;
	font-weight: 800;
	color: #4338ca;
}

.code-run__sched-ms {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.code-run__sched-m-free {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	padding: 0.4em 0.7em;
	border-radius: 6px;
	border: 1.5px solid #ddd6fe;
	background: #faf8ff;
	color: #6d28d9;
	font-weight: 800;
	font-size: 11px;
}

.code-run__sched-m-free small {
	font-size: 8px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9ca3af;
}

.code-run__sched-m-free.is-searching {
	border-color: #fcd34d;
	color: #b45309;
	background: #fffbeb;
}

.code-run__sched-m-free.is-searching small {
	color: #b45309;
}

.code-run__sched-wait-list {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.code-run__sched-w {
	display: flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.3em 0.5em;
	border-radius: 6px;
	border-left: 3px solid #9ca3af;
	background: #fff;
	font-size: 10.5px;
	color: #272a41;
}

.code-run__sched-w-status {
	padding: 0 0.4em;
	border-radius: 999px;
	background: #f1f5f9;
	color: #6b7280;
	font-size: 9px;
	font-weight: 700;
}

.code-run__sched-w-reason {
	color: #9ca3af;
	font-size: 9px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.code-run__viz-g-chip {
	padding: 0.15em 0.55em;
	border-radius: 999px;
	font-weight: 700;
	font-size: 11px;
	max-width: 9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.code-run__viz-g-chip.is-runnable {
	background: #fef3c7;
	color: #b45309;
	border: 1px solid #fcd34d;
}

.code-run__viz-g-chip.is-global {
	background: #f5f3ff;
	color: #6d28d9;
	border: 1px solid #ddd6fe;
}

.code-run__viz-g-chip.is-stolen {
	background: #fff1f2;
	color: #be123c;
	border: 1px solid #fda4af;
}

/* Схема «стек vs куча» */

.code-run__viz-stackheap {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
}

.code-run__viz-sh-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.code-run__viz-sh-title {
	font-weight: 700;
	color: #272a41;
	margin-bottom: 0.3rem;
}

.code-run__viz-sh-meta {
	color: #9ca3af;
	font-weight: 400;
	font-size: 10px;
}

.code-run__viz-sh-box {
	display: flex;
	flex-direction: column;
	gap: 3px;
	border-radius: 6px;
	padding: 6px;
	min-height: 60px;
}

.code-run__viz-sh-box.is-stack {
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	justify-content: flex-end;
}

.code-run__viz-sh-box.is-heap {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	justify-content: flex-start;
}

.code-run__viz-frame {
	background: #fff;
	border: 1px solid #e0e7ff;
	border-radius: 4px;
	padding: 3px 6px;
	color: #4338ca;
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.code-run__viz-heapobj {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.4rem;
	background: #fff;
	border: 1px solid #a7f3d0;
	border-radius: 4px;
	padding: 3px 6px;
	color: #047857;
	box-sizing: border-box;
	max-width: 100%;
	min-width: 2rem;
}

.code-run__viz-heapobj-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.code-run__viz-heapobj-size {
	color: #9ca3af;
	font-size: 10px;
	white-space: nowrap;
}

.code-run__viz-sh-caption {
	margin-top: 0.35rem;
	color: #9ca3af;
	font-size: 10px;
	line-height: 1.4;
}

.code-run__viz-sh-note {
	color: #9ca3af;
}

/* ---------- Объяснение через LLM: попап выбора ---------- */

.code-run__explain-wrap {
	position: relative;
	display: inline-flex;
	margin-left: auto;
}

.code-run__explain-pop {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 50;
	min-width: 230px;
	padding: 0.4rem;
	background: #fff;
	border: 1px solid #e9e9e9;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(39, 42, 65, 0.18);
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.code-run__explain-pop[hidden] {
	display: none;
}

.code-run__explain-option {
	display: flex;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	padding: 0.5em 0.7em;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: #272a41;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-align: left;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.code-run__explain-option:hover {
	background: #f0fdf8;
	color: #01a97d;
}

.code-run__explain-input {
	width: 100%;
	box-sizing: border-box;
	min-height: 64px;
	padding: 0.5em 0.7em;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #272a41;
	resize: vertical;
}

.code-run__explain-input:focus {
	outline: none;
	border-color: #01a97d;
}

.code-run__explain-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	padding: 0.45em 0.7em;
	border: 1px solid transparent;
	border-radius: 8px;
	background: #01a97d;
	color: #fff;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.code-run__explain-send:hover {
	background: #029f76;
}

/* ---------- Кастомные тултипы ---------- */

.code-run__tooltip {
	position: fixed;
	z-index: 1000;
	max-width: 280px;
	padding: 0.5em 0.7em;
	background: #272a41;
	color: #fff;
	font-family: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 0.75rem;
	line-height: 1.45;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(39, 42, 65, 0.28);
	pointer-events: none;
}

.code-run__tooltip::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -5px;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: #272a41;
	border-bottom-width: 0;
}

.code-run__tooltip.is-below::after {
	bottom: auto;
	top: -5px;
	border-top-width: 0;
	border-bottom: 5px solid #272a41;
}

.code-run__debug-vars .has-tooltip,
.code-run__debug-controls .has-tooltip {
	cursor: pointer;
}

.code-run__viz-lane-label {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 10px;
	fill: #4b5563;
}

.code-run__viz-lane-label.is-zombie {
	fill: #e11d48;
	font-weight: 700;
}

/* ---------- Слайдер перемотки шагов ---------- */

.code-run__debug-slider {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.5rem;
	padding: 0 0.125rem;
}

.code-run__debug-range {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 6px;
	border-radius: 999px;
	background: #e5e7eb;
	outline: none;
	cursor: pointer;
}

.code-run__debug-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #01a97d;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(39, 42, 65, 0.3);
	cursor: grab;
}

.code-run__debug-range::-webkit-slider-thumb:active {
	cursor: grabbing;
}

.code-run__debug-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #01a97d;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(39, 42, 65, 0.3);
	cursor: grab;
}

.code-run__debug-range::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: #e5e7eb;
}

.code-run__debug-range:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Редактируемый номер шага */

.code-run__debug-step.is-editable {
	cursor: pointer;
	border-bottom: 1px dashed #9ca3af;
	padding-bottom: 1px;
}

.code-run__debug-step.is-editable:hover {
	color: #01a97d;
	border-bottom-color: #01a97d;
}

.code-run__debug-step-input {
	width: 3.5rem;
	padding: 0.1em 0.35em;
	border: 1px solid #01a97d;
	border-radius: 6px;
	background: #fff;
	color: #272a41;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.2;
}

.code-run__debug-step-input:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(1, 169, 125, 0.2);
}
