/* Legal pages (Privacy, Terms, Cookies, Risk) — redesign, same system as How It Works */
.legal-page {
    max-width: 1160px; margin: 0 auto; padding: 56px 24px 96px; box-sizing: border-box;
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
}
.legal-header { max-width: 720px; margin: 0 0 24px; padding: 0; border: 0; }
.legal-title { margin: 0; font-size: 2.5rem; font-weight: 600; letter-spacing: -0.8px; line-height: 1.15; color: var(--text-primary); }
.legal-meta { margin-top: 12px; font-size: 0.8125rem; color: var(--text-tertiary); }

.legal-highlight, .risk-warning {
    max-width: 720px; box-sizing: border-box; margin: 0 0 56px;
    padding: 14px 16px; border-radius: 12px;
    font-size: 0.875rem; line-height: 1.65;
}
.legal-highlight { background: #161A1E; border: 1px solid #2B3139; color: #B7BDC6; }
.risk-warning { background: rgba(246, 70, 93, 0.06); border: 1px solid rgba(246, 70, 93, 0.25); }
.risk-warning-title { font-size: 0.875rem; font-weight: 600; }
.risk-warning p { font-size: 0.875rem !important; line-height: 1.65 !important; color: #B7BDC6 !important; margin: 6px 0 0 !important; }

/* Two columns: sticky contents + text */
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.legal-content { min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 40px; }

.legal-toc {
    position: sticky; top: 94px;
    margin: 0; padding: 0; border: 0; background: none; border-radius: 0;
    font-size: 0.875rem;
}
.legal-toc-title { padding: 0 12px 8px; margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-tertiary); }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.legal-toc li { margin: 0; }
.legal-toc a {
    min-height: 44px; display: flex; align-items: center; padding: 6px 12px; box-sizing: border-box;   /* 44px: Apple tap size */
    border-radius: 8px; font-size: 0.875rem; line-height: 1.35; color: var(--text-secondary); text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.legal-toc a:hover { color: var(--text-primary); background: rgba(30, 35, 41, 0.6); text-decoration: none; }
.legal-toc a.active { color: var(--text-primary); background: #1E2329; box-shadow: inset 2px 0 0 var(--accent); }
.legal-toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.legal-section, .legal-contact { margin: 0; scroll-margin-top: 90px; }
.legal-section h2 { margin: 0 0 12px; padding: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.2px; color: var(--text-primary); }
.legal-section h3 { margin: 20px 0 8px; font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.legal-section p, .legal-section ul li, .legal-section ol li { font-size: 0.9375rem; line-height: 1.7; color: #B7BDC6; }
.legal-section p { margin: 0 0 12px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul, .legal-section ol { margin: 0 0 12px; padding-left: 20px; }
.legal-section li { margin-bottom: 6px; }
.legal-section strong { color: var(--text-primary); font-weight: 600; }
.legal-section a, .legal-contact a { color: var(--accent); }

.legal-contact {
    padding: 18px 20px; border-radius: 14px;
    background: #161A1E; border: 1px solid #2B3139;
}
.legal-contact p { margin: 0; font-size: 0.875rem; line-height: 1.7; color: #B7BDC6; }

/* Tables */
.data-table, .cookie-table {
    width: 100%; margin: 4px 0 16px; border-collapse: separate; border-spacing: 0;
    border: 1px solid #2B3139; border-radius: 12px; overflow: hidden;
    font-size: 0.8125rem; background: #161A1E;
}
.data-table th, .cookie-table th {
    position: static; padding: 10px 14px; text-align: left;
    background: #1E2329; color: var(--text-secondary);
    font-size: 0.75rem; font-weight: 600; text-transform: none; letter-spacing: 0;
    border-bottom: 1px solid #2B3139;
}
.data-table td, .cookie-table td {
    padding: 10px 14px; vertical-align: top; color: #B7BDC6; line-height: 1.55;
    border-bottom: 1px solid #1E2329;
}
.data-table tr:last-child td, .cookie-table tr:last-child td { border-bottom: 0; }
.cookie-type-badge {
    display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
    font-size: 0.6875rem; font-weight: 600; letter-spacing: 0; text-transform: none; border: 0;
}

@media (max-width: 900px) {
    .legal-page { padding: 32px 16px 96px; }
    .legal-title { font-size: 1.875rem; letter-spacing: -0.5px; }
    .legal-highlight, .risk-warning { margin-bottom: 40px; }
    .legal-layout { grid-template-columns: 1fr; gap: 0; }
    .legal-toc { display: none; }
    .legal-content { gap: 32px; }
    .legal-section h2 { font-size: 1.125rem; }
    .legal-section p, .legal-section ul li, .legal-section ol li { font-size: 0.875rem; }
    .data-table, .cookie-table { display: block; overflow-x: auto; }
}
