:root {
	color-scheme: light;
	font-family: Inter, system-ui, sans-serif;
}

body {
	margin: 0;
	background: #f4f6fb;
	color: #1f2937;
}

.shell {
	padding: 2rem;
}

.shell__header {
	margin-bottom: 1.5rem;
}

.shell__header h1 {
	margin: 0 0 0.5rem;
}

.shell__content {
	display: block;
}

.workspace-grid {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	position: relative;
}

.workspace-toolbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 0.5rem;
}

.user-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 0.75rem;
	border-radius: 999px;
	background: #e2e8f0;
	color: #1e293b;
	font-size: 0.85rem;
	font-weight: 600;
}

.workspace-layout {
	position: relative;
}

.settings-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.35);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 20;
}

.settings-backdrop--visible {
	opacity: 1;
	pointer-events: auto;
}

.settings-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(28rem, 100vw);
	padding: 1rem;
	box-sizing: border-box;
	transform: translateX(-100%);
	transition: transform 0.2s ease;
	z-index: 30;
	pointer-events: none;
}

.settings-drawer--open {
	transform: translateX(0);
	pointer-events: auto;
}

.panel {
	background: #ffffff;
	border-radius: 0.75rem;
	padding: 1rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.panel--settings {
	display: grid;
	gap: 0.75rem;
	height: 100%;
	overflow: auto;
}

.panel--code {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.panel__header h2 {
	margin: 0;
}

.button-row--top {
	margin-bottom: 0.25rem;
}

.button--close {
	white-space: nowrap;
}

label {
	display: grid;
	gap: 0.35rem;
	font-weight: 600;
}

.profile-setting {
	padding: 0.75rem;
	border: 1px solid #bfdbfe;
	border-radius: 0.75rem;
	background: #eff6ff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
	margin-bottom: 0.25rem;
}

.checkbox-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
}

.form-control,
.editor {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cbd5e1;
	border-radius: 0.5rem;
	padding: 0.75rem;
	font: inherit;
}

.editor-grid {
	display: flex;
	align-items: stretch;
	gap: 0;
	min-width: 0;
}

.code-panel--input {
	flex: 0 0 var(--input-panel-size, calc(50% - 0.25rem));
}

.code-panel--output {
	flex: 1 1 auto;
}

.editor-splitter {
	position: relative;
	flex: 0 0 0.5rem;
	cursor: col-resize;
	touch-action: none;
}

.editor-splitter::before {
	content: "";
	position: absolute;
	inset: 0.5rem 0.125rem;
	border-radius: 999px;
	background: #cbd5e1;
}

.editor-shell {
	display: grid;
	align-items: start;
}

.editor-shell > * {
	grid-area: 1 / 1;
}

.editor-highlight,
.editor {
	min-height: 8rem;
	height: auto;
	overflow-x: auto;
	overflow-y: hidden;
	white-space: pre;
	overflow-wrap: normal;
	word-break: normal;
	font-family: Consolas, "Courier New", monospace;
	font-size: 0.95rem;
	line-height: 1.5;
}

.editor-highlight {
	margin: 0;
	box-sizing: border-box;
	border: 1px solid #cbd5e1;
	border-radius: 0.5rem;
	padding: 0.75rem;
	background: #ffffff;
	color: #000000;
	pointer-events: none;
}

.editor {
	resize: none;
	background: transparent;
	border-color: transparent;
	color: transparent;
	caret-color: #000000;
}

.editor::selection {
	background: rgba(147, 197, 253, 0.35);
}

.editor:focus {
	outline: none;
}

.editor-highlight__keyword {
	color: #0000ff;
	font-weight: 400;
}

.editor-highlight__identifier {
	color: #000000;
}

.editor-highlight__string {
	color: #a31515;
}

.editor-highlight__number {
	color: #000000;
}

.editor-highlight__comment {
	color: #008000;
	font-style: normal;
}

.editor-highlight__operator {
	color: #000000;
}

.editor-highlight__plain {
	color: #000000;
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.button {
	border: none;
	border-radius: 0.5rem;
	padding: 0.75rem 1rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.button--primary {
	background: #2563eb;
	color: #ffffff;
}

.button--secondary {
	background: #dbeafe;
	color: #1e3a8a;
}

.messages {
	margin: 1rem 0 0;
	padding-left: 1.25rem;
	color: #b91c1c;
}

@media (max-width: 1100px) {
	.settings-drawer {
		width: min(100vw, 28rem);
	}

	.editor-grid {
		flex-direction: column;
	}

	.code-panel--input,
	.code-panel--output {
		flex-basis: auto;
	}

	.editor-splitter {
		display: none;
	}
}

.file-input-hidden {
	display: none;
}
