/* Legal pages — public CMS typography + table of contents */
.legal-page-section {
    padding: 48px 20px 80px;
}

.legal-page-layout {
    max-width: 1100px;
    margin: 0 auto;
}

.legal-page-preview-banner {
    margin-bottom: 24px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fcd34d;
    font-size: 0.95rem;
    text-align: center;
}

.legal-page-header {
    text-align: center;
    margin-bottom: 40px;
}

.legal-page-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.95rem;
}

.legal-page-version {
    opacity: 0.85;
}

.legal-page-body {
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.legal-page-toc {
    position: sticky;
    top: 96px;
    padding: 20px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.legal-page-toc-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 14px;
}

.legal-page-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legal-page-toc-item {
    margin: 0 0 8px;
    line-height: 1.4;
}

.legal-page-toc-item a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.15s ease;
}

.legal-page-toc-item a:hover {
    color: #f8fafc;
}

.legal-page-toc-level-2 { padding-left: 0; }
.legal-page-toc-level-3 { padding-left: 12px; }
.legal-page-toc-level-4 { padding-left: 24px; }
.legal-page-toc-level-5 { padding-left: 36px; }
.legal-page-toc-level-6 { padding-left: 48px; }

.legal-page-content {
    max-width: 720px;
    line-height: 1.75;
    color: #cbd5e1;
    font-size: 1.05rem;
}

.prose-legal h2,
.prose-legal h3,
.prose-legal h4,
.prose-legal h5,
.prose-legal h6 {
    color: #f1f5f9;
    font-weight: 600;
    scroll-margin-top: 100px;
}

.prose-legal h2 {
    font-size: 1.65rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.prose-legal h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
}

.prose-legal h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem;
}

.prose-legal p,
.prose-legal li {
    margin-bottom: 1rem;
}

.prose-legal ul,
.prose-legal ol {
    margin: 0 0 1.25rem 1.25rem;
    padding: 0;
}

.prose-legal a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose-legal a:hover {
    color: #93c5fd;
}

.prose-legal blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid rgba(96, 165, 250, 0.6);
    background: rgba(30, 41, 59, 0.45);
    border-radius: 0 10px 10px 0;
}

.prose-legal table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.prose-legal th,
.prose-legal td {
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 10px 12px;
    text-align: left;
}

.prose-legal th {
    background: rgba(30, 41, 59, 0.6);
    color: #f1f5f9;
}

.prose-legal code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(30, 41, 59, 0.7);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.prose-legal pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.prose-legal img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

body.light-mode .legal-page-title {
    background: linear-gradient(135deg, #0f172a 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light-mode .legal-page-meta {
    color: #64748b;
}

body.light-mode .legal-page-toc {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
}

body.light-mode .legal-page-toc-item a {
    color: #475569;
}

body.light-mode .legal-page-toc-item a:hover {
    color: #0f172a;
}

body.light-mode .legal-page-content,
body.light-mode .prose-legal p,
body.light-mode .prose-legal li {
    color: #334155;
}

body.light-mode .prose-legal h2,
body.light-mode .prose-legal h3,
body.light-mode .prose-legal h4 {
    color: #0f172a;
}

@media (max-width: 900px) {
    .legal-page-body {
        grid-template-columns: 1fr;
    }

    .legal-page-toc {
        position: static;
        order: -1;
    }
}

@media (max-width: 600px) {
    .legal-page-section {
        padding-top: 32px;
        padding-bottom: 56px;
    }

    .legal-page-content {
        font-size: 1rem;
    }
}
