/* Legal pages and the shared cookie panel */
html[data-theme="light"] body:is(.route-privacy, .route-cookies) {
    --legal-surface: #f7f8f8;
    --legal-header: #edf0f1;
    --legal-card: #fff;
    --legal-ink: #192026;
    --legal-muted: #58636c;
    --legal-line: #d6dcdf;
}

html[data-theme="dark"] body:is(.route-privacy, .route-cookies) {
    --legal-surface: #000;
    --legal-header: #101214;
    --legal-card: #101214;
    --legal-ink: #f3f5f6;
    --legal-muted: #b8c0c4;
    --legal-line: #303639;
}

body:is(.route-privacy, .route-cookies) .page-header {
    background: var(--legal-header);
    color: var(--legal-ink);
    border-bottom: 1px solid var(--legal-line);
}

body:is(.route-privacy, .route-cookies) .page-header h1,
body:is(.route-privacy, .route-cookies) .legal-section h2 {
    color: var(--legal-ink);
}

body:is(.route-privacy, .route-cookies) .page-header p,
body:is(.route-privacy, .route-cookies) .legal-section p {
    color: var(--legal-muted);
}

body:is(.route-privacy, .route-cookies) > main > .section {
    background: var(--legal-surface);
    color: var(--legal-ink);
}

body:is(.route-privacy, .route-cookies) .legal-layout {
    max-width: 980px;
    gap: 1rem;
}

body:is(.route-privacy, .route-cookies) .legal-section {
    min-width: 0;
    padding: 1.5rem;
    border: 1px solid var(--legal-line);
    border-radius: 8px;
    background: var(--legal-card);
    color: var(--legal-ink);
}

body:is(.route-privacy, .route-cookies) .legal-section p {
    max-width: 76ch;
    line-height: 1.7;
}

body:is(.route-privacy, .route-cookies) .legal-table-wrap {
    max-width: 100%;
}

body:is(.route-privacy, .route-cookies) .legal-table {
    color: var(--legal-ink);
}

body:is(.route-privacy, .route-cookies) .legal-table th {
    color: var(--legal-ink);
    background: var(--legal-header);
}

body:is(.route-privacy, .route-cookies) .legal-table td {
    color: var(--legal-muted);
}

body:is(.route-privacy, .route-cookies) .legal-table th,
body:is(.route-privacy, .route-cookies) .legal-table td {
    border-color: var(--legal-line);
}

.cookie-consent__panel {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.cookie-consent__settings {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

html[data-theme="light"] .cookie-consent__settings {
    background: #fff;
}

html[data-theme="dark"] .cookie-consent__settings {
    background: #202224;
}

html[data-theme="light"] .cookie-consent__summary p,
html[data-theme="light"] .cookie-toggle small {
    color: #58636c;
}

html[data-theme="light"] .cookie-consent__links a,
html[data-theme="light"] .cookie-toggle strong {
    color: #192026;
}

html[data-theme="light"] .cookie-toggle {
    color: #192026;
    border-color: #d6dcdf;
    background: #f7f8f8;
}

@media (max-width: 600px) {
    body:is(.route-privacy, .route-cookies) .legal-section {
        padding: 1.1rem;
    }

    .cookie-consent__settings {
        grid-template-columns: 1fr;
    }
}
