/*
 * Proofloop documentation
 * ---------------------------------------------------------------------------
 * One stylesheet, no build step, no remote request of any kind — no CDN, no
 * webfont, no analytics. The documentation has to open from a double-clicked
 * file on a laptop with no internet connection, which is how a buyer reads it
 * on the train before they start, and remote assets are an Envato auto-reject
 * besides.
 *
 * The token names mirror resources/css/app.css so the docs look like the
 * product. They are duplicated rather than imported because this file is
 * shipped as static HTML alongside the application, not compiled with it.
 */

:root {
    color-scheme: light;
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-sunken: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --fg: #18181b;
    --fg-muted: #52525b;
    --fg-subtle: #71717a;
    --primary: #e11d48;
    --primary-stronger: #be123c;
    --primary-soft: #fff1f2;
    --success-soft: #ecfdf5;
    --success-strong: #047857;
    --warning-soft: #fffbeb;
    --warning-strong: #b45309;
    --danger-soft: #fef2f2;
    --danger-strong: #b91c1c;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #09090b;
        --surface: #18181b;
        --surface-sunken: #27272a;
        --border: #27272a;
        --border-strong: #3f3f46;
        --fg: #fafafa;
        --fg-muted: #a1a1aa;
        --fg-subtle: #71717a;
        --primary: #fb7185;
        --primary-stronger: #fda4af;
        --primary-soft: #27181c;
        --success-soft: #0d1f1a;
        --success-strong: #6ee7b7;
        --warning-soft: #241a09;
        --warning-strong: #fcd34d;
        --danger-soft: #261414;
        --danger-strong: #fca5a5;
    }
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--fg);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

/* ---- Masthead ---------------------------------------------------------- */

.masthead {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 5;
}
.masthead .wrap { display: flex; align-items: center; gap: .625rem; padding-top: .75rem; padding-bottom: .75rem; }
.mark {
    width: 1.875rem; height: 1.875rem; border-radius: 8px; flex: none;
    background: var(--primary); color: #ffffff;
    display: grid; place-items: center; font-weight: 700; font-size: .875rem;
}
.masthead strong { font-weight: 650; letter-spacing: -0.01em; }
.masthead .tag { color: var(--fg-subtle); font-size: .8125rem; margin-left: auto; }

/* ---- Layout ------------------------------------------------------------ */

.layout { display: block; padding: 2rem 0 4rem; }

@media (min-width: 60rem) {
    .layout { display: grid; grid-template-columns: 15rem 1fr; gap: 3rem; align-items: start; }
    nav.toc { position: sticky; top: 4.25rem; }
    nav.toc details { border: 0; padding: 0; }
    nav.toc summary { display: none; }
    nav.toc ol { display: block !important; }
}

nav.toc details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .625rem .875rem;
    margin-bottom: 1.5rem;
}
nav.toc summary { cursor: pointer; font-weight: 600; }
nav.toc ol { list-style: none; margin: .75rem 0 0; padding: 0; }
@media (min-width: 60rem) { nav.toc ol { margin-top: 0; } }
nav.toc li { margin-bottom: .1875rem; }
nav.toc a {
    display: block; padding: .3125rem .625rem; border-radius: 7px;
    color: var(--fg-muted); text-decoration: none; font-size: .9375rem;
}
nav.toc a:hover { background: var(--surface-sunken); color: var(--fg); }
nav.toc a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-stronger); font-weight: 600; }

main { min-width: 0; }

/* ---- Prose ------------------------------------------------------------- */

h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 .75rem; }
h2 { font-size: 1.3125rem; letter-spacing: -0.015em; margin: 2.75rem 0 .75rem; padding-top: .25rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 .5rem; }
h4 { font-size: .9375rem; margin: 1.25rem 0 .375rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-subtle); }
p { margin: 0 0 1rem; }
.lede { font-size: 1.0625rem; color: var(--fg-muted); margin-bottom: 2rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.375rem; }
li { margin-bottom: .375rem; }
a { color: var(--primary-stronger); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
strong { font-weight: 650; }

code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: .875em;
    background: var(--surface-sunken);
    padding: .125em .375em;
    border-radius: 5px;
}
pre {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .875rem 1rem;
    overflow-x: auto;
    font-size: .8125rem;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* ---- Tables ------------------------------------------------------------ */

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; vertical-align: top; padding: .625rem .75rem; border-bottom: 1px solid var(--border); }
th { font-weight: 650; background: var(--surface-sunken); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---- Callouts ---------------------------------------------------------- */

.note {
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: .875rem 1.125rem;
    margin: 0 0 1.5rem;
    background: var(--surface);
}
.note > :last-child { margin-bottom: 0; }
.note .label { display: block; font-weight: 650; margin-bottom: .25rem; font-size: .875rem; }
.note.tip { background: var(--success-soft); border-left-color: var(--success-strong); }
.note.warn { background: var(--warning-soft); border-left-color: var(--warning-strong); }
.note.stop { background: var(--danger-soft); border-left-color: var(--danger-strong); }
.note.calm { background: var(--primary-soft); border-left-color: var(--primary); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 1.125rem;
}
.steps > li::before {
    content: counter(step);
    position: absolute; left: 0; top: .0625rem;
    width: 1.625rem; height: 1.625rem; border-radius: 999px;
    background: var(--primary); color: #ffffff;
    display: grid; place-items: center;
    font-size: .8125rem; font-weight: 700;
}

.cards { display: grid; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 45rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 1.125rem 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card a { text-decoration: none; }

.pill {
    display: inline-block; font-size: .75rem; font-weight: 650;
    padding: .125rem .5rem; border-radius: 999px;
    background: var(--surface-sunken); color: var(--fg-muted);
    text-transform: uppercase; letter-spacing: .04em;
}
.pill.tier0 { background: var(--success-soft); color: var(--success-strong); }
.pill.tier1 { background: var(--primary-soft); color: var(--primary-stronger); }
.pill.tier2 { background: var(--warning-soft); color: var(--warning-strong); }

footer.docs-foot {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 3rem;
    color: var(--fg-subtle);
    font-size: .875rem;
}

a.skip {
    position: absolute; left: -9999px;
}
a.skip:focus {
    left: 1rem; top: 1rem; position: fixed; z-index: 10;
    background: var(--surface); padding: .625rem 1rem; border-radius: 8px;
    border: 1px solid var(--border-strong);
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
