:root {
	color-scheme: light dark;
	--bg: #f4efe9;
	--surface: #f7f3ee;     
	--fg: #1a1517;          
	--muted: #6b5d66;       
	--line: #e8e0d8;        
	--accent: #8b3a4a;
	--shadow: rgba(30, 18, 28, 0.12);
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	display: flex;
	flex-direction: column;
	font-family: system-ui, sans-serif;
	background: var(--bg);
	color: var(--fg);
}

header {
	display: flex;
	align-items: center;
	flex: 0 0 56px;
	padding: 0 24px;
	border-bottom: 1px solid var(--line);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.brand img {
	display: block;
	width: 28px;
	height: 28px;
}

.theme-toggle {
	margin-left: auto;
	padding: 6px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

main {
	flex: 1;
	min-height: 0;
	display: flex;
	gap: 12px;
	padding: 12px;
}

.editor-window,
.json-window {
	flex: 1 1 0;
	min-width: 0;
	min-height: 0;
}

.json-window {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	color: var(--fg);
}

.json-label {
	flex: 0 0 auto;
	padding: 10px 16px;
	border-bottom: 1px solid var(--line);
	font-family: ui-sans-serif, system-ui, sans-serif;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

#output {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 16px;
	overflow: auto;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 12.5px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.json-key {
	color: #e06c75;
}

.json-string {
	color: #98c379;
}

.json-number {
	color: #d19a66;
}

.json-literal {
	color: #56b6c2;
}

:root[data-theme="light"] {
	color-scheme: light;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #1a1218;
	--surface: #2a1f28;
	--fg: #f0e8e4;
	--muted: #9a8a94;
	--line: #3d2e3a;
	--accent: #c45c6a;
	--shadow: rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #1a1218;
		--surface: #2a1f28;
		--fg: #f0e8e4;
		--muted: #9a8a94;
		--line: #3d2e3a;
		--accent: #c45c6a;
		--shadow: rgba(0, 0, 0, 0.45);
	}
}
