*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-sans);
	color: var(--color-text);
	background: var(--color-bg);
	line-height: 1.7;
	font-size: 15px;
}

/* Layout */
.layout {
	display: flex;
	min-height: 100vh;
}

/* Sidebar */
.sidebar {
	width: 280px;
	min-width: 280px;
	background: var(--color-sidebar-bg);
	border-right: 1px solid var(--color-border);
	padding: 2rem 0;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.sidebar-brand {
	padding: 0 1.5rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 1rem;
}

.sidebar-brand h2 {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--color-accent);
	margin-top: 0;
	margin-bottom: 0.25rem;
}

.sidebar-brand .version {
	font-size: 0.75rem;
	color: var(--color-muted);
	font-weight: 500;
}

.sidebar-links {
	margin-top: 0.5rem;
}

.sidebar-links a {
	display: block;
	font-size: 0.8rem;
	color: var(--color-muted);
	text-decoration: none;
	margin-bottom: 0.15rem;
}

.sidebar-links a:hover {
	color: var(--color-accent);
}

.sidebar-footer {
	padding: 0.75rem 1.5rem 0;
	margin-top: auto;
	border-top: 1px solid var(--color-border);
	text-align: center;
}

.sidebar-footer .version {
	font-size: 0.7rem;
	color: var(--color-muted);
	font-weight: 400;
}

.sidebar-footer .version a {
	color: var(--color-muted);
}

.sidebar nav ul {
	list-style: none;
}

.sidebar nav > ul > li {
	margin-bottom: 0.15rem;
}

.sidebar nav a {
	display: block;
	padding: 0.4rem 1.5rem;
	color: var(--color-text);
	text-decoration: none;
	font-size: 0.875rem;
	transition: background 0.15s, color 0.15s;
}

.sidebar nav a:hover {
	background: var(--color-accent-soft);
	color: var(--color-accent);
}

.sidebar nav .section-label {
	display: block;
	padding: 1rem 1.5rem 0.3rem;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
}

.sidebar nav ul ul {
	padding-left: 1rem;
}

.sidebar nav ul ul a {
	font-size: 0.8rem;
	padding: 0.25rem 1.5rem;
	color: var(--color-muted);
}

.sidebar nav ul ul a:hover {
	color: var(--color-accent);
}

/* Main */
.main {
	flex: 1;
	max-width: 900px;
	padding: 3rem 4rem;
}

/* Typography */
h1 {
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 0.5rem;
	line-height: 1.2;
}

h2 {
	font-size: 1.5rem;
	font-weight: 700;
	margin-top: 3rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--color-border);
}

h3 {
	font-size: 1.15rem;
	font-weight: 600;
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

h4 {
	font-size: 1rem;
	font-weight: 600;
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}

p {
	margin-bottom: 1rem;
}

a {
	color: var(--color-accent);
}

.lead {
	font-size: 1.1rem;
	color: var(--color-muted);
	margin-bottom: 2rem;
}

/* Code */
code {
	font-family: var(--font-mono);
	font-size: 0.85em;
	background: var(--color-code-bg);
	padding: 0.15em 0.4em;
	border-radius: 4px;
}

pre {
	background: #1e293b;
	color: #e2e8f0;
	padding: 1.25rem 1.5rem;
	border-radius: 8px;
	overflow-x: auto;
	margin-bottom: 1.5rem;
	font-size: 0.85rem;
	line-height: 1.6;
}

pre code {
	background: none;
	padding: 0;
	color: inherit;
	font-size: inherit;
}

.code-comment {
	color: #64748b;
}

.code-string {
	color: #86efac;
}

.code-key {
	color: #93c5fd;
}

.code-value {
	color: #fbbf24;
}

.code-method {
	color: #c4b5fd;
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
}

th, td {
	text-align: left;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--color-border);
}

th {
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-muted);
	background: var(--color-sidebar-bg);
}

td code {
	font-size: 0.8em;
}

/* Alerts */
.alert {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	border-left: 4px solid;
}

.alert-info {
	background: #eff6ff;
	border-color: var(--color-info);
	color: #1e40af;
}

.alert-warning {
	background: #fffbeb;
	border-color: var(--color-warning);
	color: #92400e;
}

.alert-success {
	background: #ecfdf5;
	border-color: var(--color-success);
	color: #065f46;
}

.alert-danger {
	background: #fef2f2;
	border-color: var(--color-danger);
	color: #991b1b;
}

.alert strong {
	font-weight: 600;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 0.15em 0.55em;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 4px;
	vertical-align: middle;
}

.badge-get {
	background: #dbeafe;
	color: #1d4ed8;
}

.badge-post {
	background: #dcfce7;
	color: #166534;
}

.badge-put {
	background: #fef3c7;
	color: #92400e;
}

.badge-delete {
	background: #fee2e2;
	color: #991b1b;
}

.badge-patch {
	background: #f3e8ff;
	color: #6b21a8;
}

/* Cards */
.feature-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.feature-card {
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 1.25rem;
}

.feature-card h4 {
	margin-top: 0;
	font-size: 0.95rem;
}

.feature-card p {
	font-size: 0.85rem;
	color: var(--color-muted);
	margin-bottom: 0;
}

/* Endpoint blocks */
.endpoint {
	border: 1px solid var(--color-border);
	border-radius: 8px;
	margin-bottom: 1.5rem;
	overflow: hidden;
}

.endpoint-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: var(--color-sidebar-bg);
	border-bottom: 1px solid var(--color-border);
	font-family: var(--font-mono);
	font-size: 0.9rem;
	font-weight: 500;
}

.endpoint-body {
	padding: 1rem;
}

.endpoint-body h5 {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-muted);
	margin-bottom: 0.5rem;
	margin-top: 1rem;
}

.endpoint-body h5:first-child {
	margin-top: 0;
}

/* Lists */
ul, ol {
	margin-bottom: 1rem;
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.35rem;
}

/* Schema */
.schema-table td:first-child {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	white-space: nowrap;
	color: var(--color-accent);
}

/* Utility */
.mt-0 {
	margin-top: 0;
}

.mb-0 {
	margin-bottom: 0;
}

.text-muted {
	color: var(--color-muted);
}

.text-small {
	font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
	.sidebar {
		display: none;
	}
	
	.main {
		padding: 2rem 1.5rem;
	}
}

/* Folder tree (semantic markup, formatter-safe) */
ul.file-tree, ul.file-tree ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
ul.file-tree {
	font-family: var(--font-mono);
	font-size: 0.85rem;
	background: var(--color-code-bg);
	padding: 1rem 1.25rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	line-height: 1.7;
}
ul.file-tree ul {
	padding-left: 1.5rem;
	position: relative;
}
ul.file-tree ul::before {
	content: "";
	position: absolute;
	left: 0.4rem;
	top: 0;
	bottom: 0.85em;
	border-left: 1px solid #94a3b8;
}
ul.file-tree li {
	position: relative;
	padding-left: 1rem;
}
ul.file-tree ul > li::before {
	content: "";
	position: absolute;
	left: 0.4rem;
	top: 0.85em;
	width: 0.6rem;
	border-top: 1px solid #94a3b8;
}
ul.file-tree .ft-comment {
	color: var(--color-muted);
	margin-left: 0.5rem;
}
