:root {
	--bg: #0f1117;
	--bg-sidebar: #0f1117;
	--surface: #18181b;
	--surface-hover: #1e1e24;
	--border: #27272a;
	--border-light: #1f1f23;
	--text: #fafafa;
	--text-secondary: #a1a1aa;
	--text-muted: #71717a;
	--accent: #818cf8;
	--accent-dim: #818cf820;
	--green: #4ade80;
	--green-dim: #4ade8020;
	--orange: #fb923c;
	--orange-dim: #fb923c20;
	--red: #f87171;
	--red-dim: #f8717120;
	--blue: #60a5fa;
	--blue-dim: #60a5fa15;
	--mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
	--sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--sidebar-w: 260px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
	font-family: var(--sans);
	background: var(--bg);
	color: var(--text);
	line-height: 1.7;
	font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Sidebar ── */
.sidebar {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--sidebar-w);
	height: 100vh;
	background: var(--bg-sidebar);
	border-right: 1px solid var(--border);
	overflow-y: auto;
	padding: 24px 0;
	z-index: 100;
}
.sidebar-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 20px 24px;
	border-bottom: 1px solid var(--border);
	margin-bottom: 16px;
}
.sidebar-logo img {
	width: 36px;
	height: 36px;
	border-radius: 8px;
}
.sidebar-logo span {
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.02em;
}
.sidebar-section {
	padding: 8px 16px 4px;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
}
.sidebar a {
	display: block;
	padding: 6px 20px;
	font-size: 0.85rem;
	color: var(--text-secondary);
	border-radius: 0;
	transition: all 0.15s;
	border-left: 2px solid transparent;
}
.sidebar a:hover {
	color: var(--text);
	background: var(--surface);
	text-decoration: none;
	border-left-color: var(--border);
}
.sidebar a.active {
	color: var(--accent);
	background: var(--accent-dim);
	border-left-color: var(--accent);
}
.sidebar-badges {
	display: flex;
	gap: 6px;
	padding: 0 20px;
	margin-top: 4px;
	margin-bottom: 16px;
}

/* ── Main content ── */
.main {
	margin-left: var(--sidebar-w);
	min-height: 100vh;
}
.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	padding: 12px 48px;
	display: flex;
	align-items: center;
	gap: 12px;
	backdrop-filter: blur(8px);
}
.topbar-breadcrumb {
	font-size: 0.8rem;
	color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text-secondary); }
.content {
	max-width: 780px;
	margin: 0 auto;
	padding: 48px 48px 60vh;
}

/* ── Typography ── */
h1 {
	font-size: 2.2rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.2;
	margin-bottom: 12px;
}
h1 .highlight { color: var(--accent); }
.subtitle {
	font-size: 1.1rem;
	color: var(--text-secondary);
	line-height: 1.6;
	margin-bottom: 32px;
}
h2 {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 48px 0 16px;
	padding-top: 16px;
}
h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 32px 0 12px;
	color: var(--text);
}
h4 { font-size: 0.95rem; font-weight: 600; margin: 20px 0 8px; }
p { margin-bottom: 16px; color: var(--text-secondary); }
strong { color: var(--text); font-weight: 600; }
ul, ol { padding-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 8px; color: var(--text-secondary); }

/* ── Code ── */
code {
	font-family: var(--mono);
	font-size: 0.825rem;
	background: var(--surface);
	padding: 2px 6px;
	border-radius: 5px;
	border: 1px solid var(--border);
}
pre {
	position: relative;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 16px 20px;
	overflow-x: auto;
	margin: 16px 0;
	font-family: var(--mono);
	font-size: 0.825rem;
	line-height: 1.65;
	color: var(--text-secondary);
}
pre code {
	background: none;
	border: none;
	padding: 0;
	font-size: inherit;
}
.pre-label {
	position: absolute;
	top: 8px;
	right: 44px;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	font-family: var(--mono);
}
.copy-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 4px;
	line-height: 1;
	transition: color 0.15s;
	opacity: 0;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--green); opacity: 1; }
.copy-btn svg { display: block; }

/* ── Cards ── */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin: 20px 0;
}
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 20px;
	transition: all 0.2s;
}
.card:hover {
	border-color: var(--accent);
	background: var(--surface-hover);
}
.card-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	margin-bottom: 12px;
}
.card h4 {
	font-size: 0.9rem;
	font-weight: 600;
	margin: 0 0 6px;
	color: var(--text);
}
.card p {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin: 0;
	line-height: 1.5;
}

/* ── Callouts ── */
.callout {
	border-radius: 10px;
	padding: 16px 20px;
	margin: 20px 0;
	border: 1px solid;
	font-size: 0.875rem;
}
.callout p { margin: 0; }
.callout-title {
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}
.callout-info {
	background: var(--blue-dim);
	border-color: #60a5fa30;
}
.callout-info .callout-title { color: var(--blue); }
.callout-info p { color: var(--text-secondary); }
.callout-tip {
	background: var(--green-dim);
	border-color: #4ade8030;
}
.callout-tip .callout-title { color: var(--green); }
.callout-tip p { color: var(--text-secondary); }
.callout-warning {
	background: var(--orange-dim);
	border-color: #fb923c30;
}
.callout-warning .callout-title { color: var(--orange); }
.callout-warning p { color: var(--text-secondary); }

/* ── Tables ── */
table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
	font-size: 0.85rem;
}
th, td {
	text-align: left;
	padding: 10px 14px;
	border-bottom: 1px solid var(--border);
}
th {
	color: var(--text-muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
td { color: var(--text-secondary); }

/* ── API method badges ── */
.method {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.65rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 4px;
	min-width: 40px;
	text-align: center;
	letter-spacing: 0.02em;
}
.method-get { background: var(--accent-dim); color: var(--accent); }
.method-post { background: var(--green-dim); color: var(--green); }
.method-delete { background: var(--red-dim); color: var(--red); }

/* ── Lifecycle flow ── */
.lifecycle {
	display: flex;
	gap: 0;
	margin: 20px 0;
	flex-wrap: wrap;
}
.lifecycle-step {
	flex: 1;
	min-width: 140px;
	padding: 20px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	text-align: center;
	position: relative;
}
.lifecycle-step:first-child { border-radius: 10px 0 0 10px; }
.lifecycle-step:last-child { border-radius: 0 10px 10px 0; }
.lifecycle-step:not(:last-child)::after {
	content: '';
	position: absolute;
	right: -1px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border: 6px solid transparent;
	border-left-color: var(--border);
	z-index: 1;
}
.lifecycle-step .number {
	font-size: 0.7rem;
	color: var(--text-muted);
	display: block;
	margin-bottom: 4px;
}
.lifecycle-step .label { font-weight: 700; font-size: 0.95rem; }
.lifecycle-step .desc {
	font-size: 0.75rem;
	color: var(--text-muted);
	margin-top: 6px;
	line-height: 1.4;
}

/* ── Badges ── */
.badge {
	display: inline-block;
	font-size: 0.65rem;
	padding: 2px 8px;
	border-radius: 5px;
	font-weight: 600;
	letter-spacing: 0.03em;
}
.badge-live { background: var(--green-dim); color: var(--green); }
.badge-testnet { background: var(--orange-dim); color: var(--orange); }

/* ── Dividers ── */
.divider {
	border: none;
	border-top: 1px solid var(--border);
	margin: 40px 0;
}

/* ── Section anchors ── */
section { scroll-margin-top: 80px; }

/* ── Footer ── */
footer {
	padding: 32px 48px;
	color: var(--text-muted);
	font-size: 0.8rem;
	border-top: 1px solid var(--border);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text-secondary); }

/* ── Language switcher ── */
.lang-switcher { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 0.8rem; }
.lang-switcher a { color: var(--text-muted); padding: 4px 8px; border-radius: 4px; }
.lang-switcher a:hover { color: var(--text); text-decoration: none; }
.lang-switcher a.active { color: var(--accent); background: var(--accent-dim); }
.lang-switcher .sep { color: var(--border); }

/* ── Mobile ── */
@media (max-width: 860px) {
	.sidebar { display: none; }
	.main { margin-left: 0; }
	.content { padding: 32px 20px 64px; }
	.topbar { padding: 12px 20px; }
	footer { padding: 24px 20px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
