:root {
    color-scheme: light;
    --ink: #161616;
    --muted: #6b6862;
    --line: #e4e1da;
    --paper: #f5f4f1;
    --panel: #fff;
    --sidebar: #161616;
    --ok: #1f7a45;
    --warn: #8a5a12;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.6;
}

a { color: inherit; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--sidebar);
    color: #f4f2ee;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.wordmark {
    display: block;
    line-height: 0;
    text-decoration: none;
    padding: 0 8px;
}

.wordmark img {
    display: block;
    width: 100%;
    height: auto;
    filter: invert(1);
}

.sidebar nav { display: grid; gap: 16px; }

.sidebar h2 {
    margin: 0 0 6px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8d8a84;
}

.sidebar a {
    display: block;
    text-decoration: none;
    padding: 6px 10px;
    color: #d9d6d0;
}

.sidebar a.active { background: #2a2a2a; color: #fff; }

.sidebar .spacer { flex: 1; }

.sidebar a.dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 8px;
    padding: 8px 10px;
    border: 1px solid #3a3a3a;
    font-size: 13px;
}

.sidebar a.dashboard svg {
    width: 14px;
    height: 14px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.content { padding: 28px 40px 80px; }

.topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.lang-toggle { display: grid; grid-template-columns: 1fr 1fr; width: 96px; border: 1px solid var(--line); background: #fff; }

.lang-toggle a {
    text-align: center;
    text-decoration: none;
    padding: 6px 0;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.lang-toggle a.active { background: var(--ink); color: #fff; }

article { max-width: 44rem; }

article h1, article h2, .toc h2 {
    font-family: "League Spartan", "Avenir Next", sans-serif;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

article h1 { margin: 0 0 12px; font-size: 40px; }

article h2 { margin: 36px 0 10px; font-size: 24px; }

article h3 { margin: 22px 0 8px; font-size: 16px; }

.lede { font-size: 18px; margin-top: 0; }

.actions { display: flex; gap: 16px; align-items: center; margin: 22px 0; }

a.button {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
}

a.quiet { color: var(--muted); }

.methods, .steps { margin: 0; padding: 0; list-style: none; }

.methods { display: grid; gap: 12px; }

.methods li, .callout, .code, table, .toc {
    background: var(--panel);
    border: 1px solid var(--line);
}

.methods li { padding: 14px 16px; }

.methods strong { display: block; }

.methods p, .callout p { margin: 6px 0 0; }

.tag {
    float: right;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    padding: 2px 8px;
}

.tag.ok { color: var(--ok); border-color: #cfe3d6; }

.tag.wait { color: var(--warn); border-color: #eadcbf; }

.callout { padding: 14px 16px; margin: 18px 0; }

.callout strong { font-family: "League Spartan", "Avenir Next", sans-serif; }

.steps { display: grid; gap: 14px; counter-reset: step; }

.steps li {
    padding-left: 42px;
    position: relative;
}

.steps h2 { margin: 0 0 8px; font-size: 22px; }

.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--ink);
    text-align: center;
    line-height: 26px;
    font-size: 13px;
}

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

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

th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.code {
    margin: 12px 0 20px;
    background: #1e2420;
    border-color: #1e2420;
    color: #e8e4dc;
}

.code-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #2d3830;
    color: #9dcead;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.code button {
    background: transparent;
    border: 0;
    color: #e8e4dc;
    cursor: pointer;
    font: inherit;
    letter-spacing: 0;
    text-transform: none;
    font-size: 13px;
}

pre { margin: 0; padding: 14px 16px; overflow: auto; }

code, pre { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 13px; }

article :not(pre) > code {
    font-size: 0.92em;
    color: #9a2f2f;
    background: #f8f1f1;
    padding: 1px 4px;
}

.host-cell { white-space: nowrap; }

.copy-host {
    margin-left: 8px;
    border: 0;
    background: transparent;
    color: #9a2f2f;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    vertical-align: baseline;
}

.tok-str { color: #d7e8cc; }
.tok-key { color: #f3d7b0; }
.tok-word, .tok-flag { color: #9dcead; }
.tok-num { color: #e7c98a; }
.tok-url { color: #b7d4c4; }

.toc { padding: 12px 16px; margin: 0 0 22px; }

.toc h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

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

.pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.pager a { text-decoration: none; }

.pager span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 900px) {
    .content { padding: 24px 20px 64px; }
    article h1 { font-size: 32px; }
}

@media (max-width: 640px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        z-index: 2;
    }
    .sidebar nav { display: flex; gap: 0; }
    .sidebar h2, .sidebar .spacer { display: none; }
    .sidebar a, .sidebar .dashboard { white-space: nowrap; }
    .content { padding: 20px 16px 48px; }
}
