.code {
	display: flex;
	flex-direction: column;
	width: 600px;
	border: solid 1px rgba(0, 0, 0, 0.05);
	border-radius: 10px;
	background: hsl(220, 13%, 18%);
	box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

@media screen and (max-width: 720px) {
	.code {
		width: 100%;
	}
}

@media screen and (prefers-color-scheme: dark) {
	.code {
		border: solid 1px rgba(255, 255, 255, 0.175);
		box-shadow: 2px 2px 4px rgba(255, 255, 255, 0.025);
	}
}

/* ── Code editor body ────────────────────────────────────────────── */

.code-editor {
	display: flex;
	align-items: flex-start;
	background: hsl(220, 13%, 18%);
}

/* Line numbers are a separate element — selection never crosses the boundary */
.code-line-numbers {
	display: flex;
	flex-direction: column;
	padding: 10px 0.75em;
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
	user-select: none;
	font-family:
		"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
	font-size: 10pt;
	line-height: 1.5;
	color: hsl(220, 14%, 40%);
	text-align: right;
}

.code-line-number {
	display: block;
	line-height: 1.5;
	min-width: 1.5ch;
}

/* ── Title bar ───────────────────────────────────────────────────── */

.code #title-bar {
	padding: 4px;
	display: grid;
	width: 100%;
	align-items: center;
	justify-content: center;
	grid-template-columns: 20% 60% 20%;
	border-bottom: solid 1px rgba(255, 255, 255, 0.1);
}

.code #title-bar #title-bar-title {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10pt;
	color: white;
	font-weight: 700;
}

.code #title-bar #title-bar-buttons {
	display: flex;
	padding: 4px;
	width: 56px;
	justify-content: space-between;
}

.code #title-bar #title-bar-buttons .title-bar-button {
	width: 12px;
	height: 12px;
	border-radius: 6px;
}

.code #title-bar #title-bar-buttons #close {
	background: rgb(255, 95, 87);
}

.code #title-bar #title-bar-buttons #minimize {
	background: rgb(254, 188, 47);
}

.code #title-bar #title-bar-buttons #maximize {
	background: rgb(40, 200, 64);
}

.code #title-bar #title-bar-actions {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
}

.code #title-bar #title-bar-actions .title-bar-action {
	cursor: pointer;
	font-size: 8pt;
	text-transform: uppercase;
	font-weight: 700;
	padding: 4px 8px;
	border: none;
	border-radius: 4px;
	color: rgb(143, 236, 174);
	background: rgba(143, 236, 174, 0.2);
	transition: background-color, color;
	transition-duration: 0.15s;
	transition-timing-function: ease-out;
}

.code #title-bar #title-bar-actions .title-bar-action:hover {
	background: rgba(143, 236, 174, 0.3);
	color: rgb(205, 255, 222);
}
