body.legal-page { background: #050816 !important; --bs-body-bg: #050816; }
html:has(body.legal-page),
body.legal-page {
	overflow-x: clip !important;
	overflow-y: visible !important;
}
body.legal-page main { position: relative; z-index: 1; background: transparent !important; overflow: visible; }

.legal-hero { padding: 3.5rem 0 1.5rem; text-align: center; }
.legal-hero h1 { color: #fff !important; font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; }
.legal-hero .lead { color: rgba(255,255,255,0.65) !important; max-width: 640px; margin: 0.5rem auto 0; font-size: 0.95rem; }

.legal-mobile-progress {
	display: none;
	position: sticky;
	top: 4.5rem;
	z-index: 5;
	margin-bottom: 1rem;
	padding: 0.55rem 0.75rem;
	background: rgba(5,8,22,0.92);
	border: 1px solid rgba(124,58,237,0.25);
	border-radius: 12px;
	backdrop-filter: blur(8px);
}
.legal-mobile-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #a78bfa;
	font-weight: 700;
	margin-bottom: 0.4rem;
}
.legal-mobile-progress-track {
	height: 4px;
	background: rgba(255,255,255,0.1);
	border-radius: 999px;
	overflow: hidden;
}
.legal-mobile-progress-fill {
	display: block;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, #7c3aed, #06b6d4);
	border-radius: 999px;
	transition: width 0.15s ease;
}

.legal-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
	margin-bottom: 2rem;
	align-items: start;
	position: relative;
}
@media (min-width: 992px) {
	.legal-layout { grid-template-columns: 240px minmax(0, 1fr); }
	.legal-toc-col { align-self: stretch; }
}

.legal-toc-col {
	position: relative;
	align-self: start;
	min-width: 0;
}
@media (max-width: 991px) {
	.legal-toc-col { display: none; }
	.legal-mobile-progress { display: block; }
}

.legal-toc-pin {
	width: 100%;
	will-change: transform;
}
.legal-toc-pin.is-fixed {
	position: fixed;
	z-index: 50;
}
.legal-toc-pin.is-bottom {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
}

.legal-toc {
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 14px;
	padding: 1rem 1rem 0.85rem;
	max-height: calc(100vh - 7rem);
	display: flex;
	flex-direction: column;
}

.legal-toc-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.55rem;
}
.legal-toc-progress-label {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a78bfa;
	font-weight: 700;
}
.legal-toc-progress-pct {
	font-size: 0.78rem;
	font-weight: 800;
	color: #67e8f9;
	font-variant-numeric: tabular-nums;
}

.legal-toc-body {
	display: flex;
	gap: 0.7rem;
	flex: 1;
	min-height: 0;
}

.legal-toc-rail {
	width: 4px;
	flex-shrink: 0;
	background: rgba(255,255,255,0.08);
	border-radius: 999px;
	position: relative;
	align-self: stretch;
	min-height: 120px;
}
.legal-toc-rail-fill {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 0%;
	background: linear-gradient(180deg, #7c3aed 0%, #06b6d4 100%);
	border-radius: 999px;
	box-shadow: 0 0 12px rgba(124,58,237,0.45);
	transition: height 0.15s ease;
}

.legal-toc h2 {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a78bfa;
	margin: 0 0 0.65rem;
	font-weight: 700;
}

.legal-toc-list {
	margin: 0;
	padding-left: 1.05rem;
	font-size: 0.82rem;
	line-height: 1.55;
	overflow-y: auto;
	flex: 1;
	scrollbar-width: thin;
	scrollbar-color: rgba(124,58,237,0.5) transparent;
}
.legal-toc-list::-webkit-scrollbar { width: 4px; }
.legal-toc-list::-webkit-scrollbar-thumb {
	background: rgba(124,58,237,0.45);
	border-radius: 999px;
}

.legal-toc-list a {
	color: rgba(255,255,255,0.62);
	text-decoration: none;
	transition: color 0.15s ease;
}
.legal-toc-list a:hover { color: #c4b5fd; }
.legal-toc-list a.is-active {
	color: #fff;
	font-weight: 700;
}
.legal-toc-list li.is-active::marker { color: #a78bfa; }

.legal-card {
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 16px;
	padding: 1.5rem 1.65rem;
	color: rgba(255,255,255,0.82);
	font-size: 0.94rem;
	line-height: 1.65;
}
.legal-card section { scroll-margin-top: 6rem; }
.legal-card h2 {
	color: #fff;
	font-size: 1.12rem;
	font-weight: 700;
	margin: 1.75rem 0 0.65rem;
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card h3 {
	color: #e2e8f0;
	font-size: 0.98rem;
	font-weight: 600;
	margin: 1.1rem 0 0.45rem;
}
.legal-card p { margin-bottom: 0.85rem; }
.legal-card ul, .legal-card ol { padding-left: 1.25rem; margin-bottom: 0.85rem; }
.legal-card li { margin-bottom: 0.35rem; }
.legal-card a { color: #67e8f9; font-weight: 600; }
.legal-card a:hover { color: #a5f3fc; }
.legal-card table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.75rem 0 1rem;
	font-size: 0.88rem;
}
.legal-card th, .legal-card td {
	border: 1px solid rgba(255,255,255,0.12);
	padding: 0.55rem 0.65rem;
	text-align: left;
	vertical-align: top;
}
.legal-card th { background: rgba(124,58,237,0.15); color: #fff; font-weight: 600; }
.legal-card code {
	background: rgba(124,58,237,0.15);
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	font-size: 0.85em;
	color: #c4b5fd;
}

.legal-note {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255,255,255,0.1);
	font-size: 0.82rem;
	color: rgba(255,255,255,0.55);
	font-style: italic;
}

.legal-crosslinks {
	margin-top: 1rem;
	font-size: 0.88rem;
	color: rgba(255,255,255,0.65);
}

@media (prefers-reduced-motion: reduce) {
	.legal-toc-rail-fill,
	.legal-mobile-progress-fill { transition: none; }
}
