:root {
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Segoe UI", Arial, sans-serif;
	background: #0f1115;
	color: #e7e7ea;
}

.app-shell {
	display: grid;
	grid-template-columns: 280px 1fr;
	min-height: 100vh;
}

.sidebar {
	border-right: 1px solid #262a33;
	background: #151922;
	padding: 14px;
}

.sidebar-header {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
}

.sidebar-header h1 {
	margin: 0;
	font-size: 22px;
}

.page-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.page-item {
	padding: 10px;
	border: 1px solid #313641;
	border-radius: 8px;
	background: #1a1f2b;
	cursor: pointer;
	transition: border-color 0.12s ease;
}

.page-item.active {
	border-color: #5f84ff;
}

.workspace {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.workspace-header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
}

.page-title {
	flex: 1;
	font-size: 20px;
	background: #161b24;
	border: 1px solid #303746;
	color: #e9e9ef;
	border-radius: 8px;
	padding: 10px 12px;
}

.toolbar {
	display: flex;
	gap: 8px;
}

.btn {
	border: 1px solid #3a4150;
	background: #212734;
	color: #eceef3;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
}

.btn:hover {
	border-color: #5e6475;
}

.btn-primary {
	background: #3558ca;
	border-color: #4c6de0;
}

.hint-bar {
	border: 1px dashed #394252;
	border-radius: 8px;
	padding: 8px 10px;
	color: #a9adba;
}

.editor {
	background: #131722;
	border: 1px solid #2f3440;
	border-radius: 10px;
	min-height: 70vh;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.block {
	border: 1px solid #303748;
	border-radius: 8px;
	background: #191f2c;
	overflow: hidden;
}

.block-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 10px;
	border-bottom: 1px solid #2e3542;
	background: #1f2635;
}

.drag-handle {
	cursor: move;
	color: #9095a4;
	user-select: none;
}

.block-actions {
	display: flex;
	gap: 8px;
}

.icon-btn {
	border: 1px solid #40495a;
	background: #262f41;
	color: #e9ebf1;
	border-radius: 6px;
	padding: 4px 8px;
	cursor: pointer;
}

.text-content {
	width: 100%;
	min-height: 88px;
	border: none;
	resize: vertical;
	background: #191f2c;
	color: #edf0f8;
	padding: 10px;
	font-size: 15px;
}

.text-content:focus,
.page-title:focus {
	outline: 2px solid #5573d4;
}

.image-content {
	width: 100%;
	display: block;
	max-height: 720px;
	object-fit: contain;
}

.inverted {
	filter: invert(1);
}

@media (max-width: 1000px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		border-right: none;
		border-bottom: 1px solid #262a33;
	}

	.workspace-header {
		flex-direction: column;
		align-items: stretch;
	}
}
