/* The published legal documents (/legal). A fixed light page in the same navy-on-white as the sign-in and
   signup screens; the staff app's dark theme paints html and body, so this page repaints them. */

html:has(.lgl-root),
html:has(.lgl-root) body {
    background: #f6f7f9;
    color-scheme: light;
}

/* #app carries the dark theme's background too, so the page paints its own. */
.lgl-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f6f7f9;
    color: #1c2533;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}

.lgl-root a {
    color: #1e3a8a;
    text-underline-offset: 2px;
}

/* ---- Bar ---- */
.lgl-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 40px);
    background: #0f1b3d;
}

.lgl-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.lgl-root .lgl-brand { color: #fff; }

.lgl-brand img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.lgl-brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}

.lgl-brand-sub {
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .25);
    color: #c7d0e0;
    font-size: .9rem;
}

.lgl-bar-links {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: .9rem;
}

.lgl-root .lgl-bar-links a {
    color: #dfe5f0;
    text-decoration: none;
}

.lgl-root .lgl-bar-links a.lgl-cta {
    padding: 7px 14px;
    border-radius: 6px;
    background: #d9a441;
    color: #0f1b3d;
    font-weight: 600;
}

/* ---- Page ---- */
.lgl-main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px clamp(16px, 4vw, 40px) 56px;
}

.lgl-head {
    max-width: 760px;
    margin-bottom: 28px;
}

.lgl-head h1 {
    margin: 6px 0 6px;
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    font-weight: 600;
    line-height: 1.2;
}

.lgl-crumb {
    font-size: .88rem;
    text-decoration: none;
}

.lgl-lead {
    margin: 8px 0;
    color: #334155;
    font-size: 1.05rem;
}

.lgl-meta {
    margin: 0;
    color: #64748b;
    font-size: .88rem;
}

/* ---- Index ---- */
.lgl-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
}

.lgl-card {
    display: grid;
    align-content: start;
    gap: 6px;
    height: 100%;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lgl-card:hover,
.lgl-card:focus-visible {
    border-color: #94a3b8;
    box-shadow: 0 4px 14px rgba(15, 27, 61, .08);
}

.lgl-root .lgl-card-title {
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

.lgl-card-text {
    color: #475569;
    font-size: .92rem;
    line-height: 1.5;
}

.lgl-who h2 {
    margin: 0 0 6px;
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.lgl-who p {
    margin: 0 0 4px;
    color: #334155;
}

/* ---- Document ---- */
.lgl-layout.has-toc {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 40px;
}

.lgl-toc {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: .86rem;
    line-height: 1.4;
}

.lgl-toc-title {
    margin-bottom: 8px;
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.lgl-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lgl-toc li + li {
    margin-top: 6px;
}

.lgl-toc a {
    text-decoration: none;
}

.lgl-doc {
    max-width: 760px;
    min-width: 0;
}

.lgl-doc h2 {
    margin: 32px 0 10px;
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.lgl-doc h2:first-child {
    margin-top: 0;
}

/* Sub-sections, used by the privacy notice: a step below h2, never above it. */
.lgl-doc h3 {
    margin: 22px 0 8px;
    color: #0f1b3d;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.lgl-doc p {
    margin: 0 0 12px;
}

.lgl-doc strong {
    color: #0f1b3d;
    font-weight: 600;
}

.lgl-doc ul,
.lgl-doc ol {
    margin: 0 0 14px;
    padding-left: 2.4em;
}

.lgl-doc li {
    margin-bottom: 6px;
}

/* Numbered sub-items read "(1)", "(2)" - the form the clauses refer to them by, such as clause 6.2(1). */
.lgl-doc ol {
    counter-reset: lgl-item;
    list-style: none;
}

.lgl-doc ol > li {
    position: relative;
    counter-increment: lgl-item;
}

.lgl-doc ol > li::before {
    content: "(" counter(lgl-item) ")";
    position: absolute;
    left: -2.4em;
    color: #64748b;
}

.lgl-doc p:target,
.lgl-doc h2:target {
    margin-left: -10px;
    padding-left: 10px;
    border-left: 3px solid #d9a441;
    background: #fff8e8;
}

.lgl-table-wrap {
    margin: 0 0 16px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.lgl-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    line-height: 1.5;
}

.lgl-doc th,
.lgl-doc td {
    padding: 9px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
}

.lgl-doc th {
    background: #f8fafc;
    color: #0f1b3d;
    font-weight: 600;
}

.lgl-doc tr:last-child td {
    border-bottom: 0;
}

/* ---- Footer ---- */
.lgl-foot {
    padding: 20px clamp(16px, 4vw, 40px);
    border-top: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: .85rem;
}

.lgl-foot p {
    max-width: 1040px;
    margin: 0 auto 4px;
}

@media (max-width: 860px) {
    .lgl-layout.has-toc {
        display: block;
    }

    .lgl-toc {
        position: static;
        max-height: none;
        margin-bottom: 24px;
    }

    .lgl-toc ol {
        columns: 2;
        column-gap: 18px;
    }

    .lgl-toc li {
        break-inside: avoid;
    }
}

@media (max-width: 480px) {
    .lgl-brand-sub,
    .lgl-bar-links a:not(.lgl-cta) {
        display: none;
    }

    .lgl-toc ol {
        columns: 1;
    }
}
