@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
	--legal-bg: #f0f2f5;
	--legal-card: #fff;
	--legal-text: #1a1a1a;
	--legal-muted: #666;
	--legal-border: #e0e0e0;
	--legal-accent: #141414;
	--legal-max: 760px;
}

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

body.legal-page {
	font-family: 'DM Sans', system-ui, sans-serif;
	background: var(--legal-bg);
	color: var(--legal-text);
	line-height: 1.65;
	padding: 72px 20px 48px;
}

.legal-header {
	max-width: var(--legal-max);
	margin: 0 auto 24px;
}

.legal-home {
	display: inline-block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--legal-muted);
	text-decoration: none;
	margin-bottom: 16px;
}

.legal-home:hover {
	color: var(--legal-accent);
}

.legal-doc-title {
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin-bottom: 8px;
}

.legal-updated {
	font-size: 0.8125rem;
	color: var(--legal-muted);
}

.legal-nav {
	max-width: var(--legal-max);
	margin: 0 auto 28px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.legal-nav-link {
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--legal-card);
	border: 1px solid var(--legal-border);
	color: var(--legal-muted);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.legal-nav-link:hover,
.legal-nav-link.is-active {
	background: var(--legal-accent);
	border-color: var(--legal-accent);
	color: #fff;
}

.legal-main {
	max-width: var(--legal-max);
	margin: 0 auto;
	background: var(--legal-card);
	border-radius: 16px;
	border: 1px solid var(--legal-border);
	padding: 32px 28px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.legal-intro {
	font-size: 1.05rem;
	color: var(--legal-muted);
	margin-bottom: 28px;
}

.legal-section {
	margin-bottom: 28px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--legal-border);
}

.legal-section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.legal-section h2 {
	font-size: 1.125rem;
	font-weight: 700;
	margin-bottom: 12px;
}

.legal-body p {
	margin-bottom: 12px;
}

.legal-body p:last-child {
	margin-bottom: 0;
}

.legal-body ul {
	margin: 0 0 12px 1.25rem;
	padding: 0;
}

.legal-body {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.legal-body table {
	display: block;
	width: max-content;
	min-width: 100%;
	max-width: none;
}

.legal-body li {
	margin-bottom: 6px;
}

.legal-body a {
	color: var(--legal-accent);
	font-weight: 500;
}

.legal-body code {
	font-size: 0.875em;
	background: #f3f3f3;
	padding: 2px 6px;
	border-radius: 4px;
}

.legal-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	margin: 12px 0;
}

.legal-table th,
.legal-table td {
	border: 1px solid var(--legal-border);
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}

.legal-table th {
	background: #f8f8f8;
	font-weight: 600;
}

.legal-site-footer {
	max-width: var(--legal-max);
	margin: 32px auto 0;
	text-align: center;
	font-size: 0.8125rem;
	color: var(--legal-muted);
}

.legal-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 10px;
	margin-top: 12px;
}

.legal-footer a {
	color: var(--legal-muted);
	text-decoration: none;
	font-weight: 500;
}

.legal-footer a:hover {
	color: var(--legal-accent);
	text-decoration: underline;
}

.legal-footer-sep {
	color: #ccc;
	user-select: none;
}

@media (max-width: 600px) {
	body.legal-page {
		padding-top: 64px;
	}

	.legal-main {
		padding: 24px 18px;
	}

	.legal-table {
		font-size: 0.8125rem;
	}

	.legal-table th,
	.legal-table td {
		padding: 8px;
	}
}

.policy-lang {
	display: none;
}

.policy-lang.active {
	display: block;
}

.policy-blocks-order {
	display: none !important;
}

.policy-add-section-wrap-top {
	margin-bottom: 20px;
	text-align: center;
}

.policy-add-section-wrap-bottom {
	margin-top: 20px;
	text-align: center;
}

body:not(.legal-page--edit) .policy-add-section-wrap {
	display: none !important;
}

body.legal-page--edit .policy-add-section-wrap-bottom.is-empty-hidden {
	display: none !important;
}

.policy-add-section-btn {
	padding: 10px 18px;
	border-radius: 8px;
	border: 1px dashed var(--legal-accent);
	background: rgba(20, 20, 20, 0.04);
	color: var(--legal-accent);
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}

.policy-add-section-btn:hover {
	background: rgba(20, 20, 20, 0.08);
}

.policy-block {
	position: relative;
	margin-bottom: 20px;
}

body:not(.legal-page--edit) .policy-block-tools {
	display: none !important;
}

.policy-block-tools {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 6px;
}

.policy-block-delete {
	padding: 4px 10px;
	font-size: 0.6875rem;
	border-radius: 6px;
	border: 1px solid rgba(220, 38, 38, 0.35);
	background: #fef2f2;
	color: #b91c1c;
	cursor: pointer;
	font-family: inherit;
}

.policy-block-delete:hover {
	background: #fee2e2;
}

.policy-block-fixed-top {
	margin-bottom: 20px;
}

.policy-meta-updated {
	font-size: 0.8125rem;
	color: var(--legal-muted);
	margin-bottom: 20px;
}
