/*
 * Public Privacy Policy and Terms of Service pages (RBD-2609, views/layouts/legal.php).
 *
 * These pages load no React bundle, so the --app-* variables that theme.ts publishes don't exist here.
 * The values below are copied from bundle/src/design-system/tokens.ts (named in each comment) and must
 * follow it if those tokens change.
 */
:root {
    --legal-text: #1D2530;        /* neutral[900] */
    --legal-text-muted: #475467;  /* neutral[700] */
    --legal-border: #E4E7EC;      /* neutral[200] */
    --legal-surface: #F9FAFB;     /* neutral[50] */
    --legal-page: #FFFFFF;        /* neutral[0] */
    --legal-link: #167A57;        /* emerald.strong (AA on white) */
    --legal-link-hover: #14694B;  /* emerald.deep */
    --legal-todo-bg: #FBBF2433;   /* status.warning.light at 20% */
    --legal-todo-border: #B45309; /* status.warning.dark */
    --legal-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* fontFamily.sans */
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--legal-page);
    color: var(--legal-text);
    font-family: var(--legal-font);
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: var(--legal-link);
}

a:hover {
    color: var(--legal-link-hover);
}

.legal-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px;
}

.legal-header {
    border-bottom: 1px solid var(--legal-border);
}

.legal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.legal-logo img {
    display: block;
    height: auto;
    max-width: 100%;
}

.legal-header-nav {
    display: flex;
    gap: 20px;
    font-weight: 500;
}

.legal-header-nav a {
    color: var(--legal-text-muted);
    text-decoration: none;
}

.legal-header-nav a[aria-current="page"] {
    color: var(--legal-link);
}

.legal-main {
    padding-top: 32px;
    padding-bottom: 48px;
}

h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 8px;
}

h2 {
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 40px 0 12px;
    scroll-margin-top: 16px;
}

h3 {
    font-size: 1.05rem;
    margin: 24px 0 8px;
}

.legal-updated {
    color: var(--legal-text-muted);
    margin: 0 0 24px;
}

.legal-toc {
    background: var(--legal-surface);
    border: 1px solid var(--legal-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 24px 0 8px;
}

.legal-toc p {
    margin: 0 0 8px;
    font-weight: 600;
}

.legal-toc ol {
    margin: 0;
    padding-left: 20px;
}

ul,
ol {
    padding-left: 24px;
}

li {
    margin-bottom: 6px;
}

.legal-table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 0.95rem;
}

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

th {
    background: var(--legal-surface);
    font-weight: 600;
}

/* Placeholders that legal must fill in before these pages are published. */
.legal-todo {
    background: var(--legal-todo-bg);
    border: 1px dashed var(--legal-todo-border);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 500;
}

.legal-caps {
    text-transform: uppercase;
}

.legal-footer {
    border-top: 1px solid var(--legal-border);
    color: var(--legal-text-muted);
    font-size: 0.9rem;
}

.legal-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 20px;
    padding-bottom: 20px;
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    .legal-logo img {
        width: 128px;
    }
}
