/* docs.labeeny.com — docs sections (api/, …). Shares its tokens with api.labeeny.com. */
:root {
    --ink: #0d1a08;
    --text: #1f2a19;
    --muted: #5f6a59;
    --subtle: #8a9384;
    --bg: #f7f9f4;
    --surface: #ffffff;
    --surface-2: #f8faf5;
    --border: #e4e9de;
    --border-strong: #d3dacb;
    --accent: #5f8d17;
    --accent-strong: #4a7110;
    --accent-soft: #eef5e2;
    --ring: rgba(95, 141, 23, 0.28);
    --code-bg: #0f1b0a;
    --code-bar: #17260f;
    --code-text: #e8eee1;
    --code-border: rgba(255, 255, 255, 0.08);
    --waiting: #c98a00;
    --waiting-surface: #fffaeb;
    --shadow-sm: 0 1px 2px rgba(16, 26, 10, 0.05);
    --shadow-md: 0 1px 2px rgba(16, 26, 10, 0.04), 0 12px 32px -16px rgba(16, 26, 10, 0.18);
    --font-sans: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sidebar-width: 264px;
    --top-bar-height: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-bar-height) + 20px); }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-decoration-color: rgba(74, 113, 16, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* Header */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--top-bar-height);
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid #d7e6bd;
}
.top-links { display: flex; align-items: center; gap: 22px; }
.top-links a { color: var(--text); font-size: 0.92rem; font-weight: 600; text-decoration: none; transition: color 0.15s; }
.top-links a:hover { color: var(--accent-strong); }
.top-links a[aria-current="page"] { color: var(--accent-strong); }
.button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(16, 26, 10, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: background 0.15s;
}
.button:hover { background: #1c3013; }

/* Layout */
.layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); max-width: 1220px; margin: 0 auto; }

.sidebar { border-right: 1px solid var(--border); }
#toc {
    position: sticky;
    top: var(--top-bar-height);
    max-height: calc(100vh - var(--top-bar-height));
    overflow-y: auto;
    padding: 28px 14px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
#toc a {
    position: relative;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
#toc a.sub { padding-left: 26px; font-weight: 400; color: var(--muted); }
#toc a:hover { background: var(--surface); color: var(--ink); }
#toc a.current { background: var(--accent-soft); color: var(--accent-strong); }
#toc a.current::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.content { padding: 44px 56px 72px; min-width: 0; max-width: 860px; }
.content section { margin-bottom: 8px; }

h1 { font-size: 2.4rem; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 12px; color: var(--ink); }
h2 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.02em; margin: 56px 0 14px; color: var(--ink); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; margin: 36px 0 10px; color: var(--ink); }
h4 { font-size: 1.02rem; margin: 26px 0 8px; color: var(--ink); }
.lead { font-size: 1.12rem; line-height: 1.65; color: var(--muted); max-width: 680px; }

/* The flow at a glance */
.flow-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0; }
.flow-strip span {
    padding: 7px 13px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}
.flow-strip span.optional { border-style: dashed; color: var(--muted); box-shadow: none; }
.flow-strip i { font-style: normal; color: var(--subtle); }

/* Code */
code {
    font-family: var(--font-mono);
    font-size: 0.84em;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
    word-break: break-word;
}

pre {
    position: relative;
    margin: 14px 0 18px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--code-bg);
    color: var(--code-text);
    border: 1px solid var(--code-border);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    line-height: 1.6;
}
pre code { background: none; border: none; padding: 0; font-size: 0.82rem; color: inherit; word-break: normal; }
/* Muted syntax colours: low saturation, so the code stays calm on the dark green. */
.tok-comment { color: #84957a; font-style: italic; }
.tok-string { color: #c6d6a1; }
.tok-key { color: #a6c9c1; }
.tok-number { color: #dcc797; }
.tok-keyword { color: #e5ca8c; }

pre.diagram { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: none; font-size: 0.86rem; }

pre .copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    font: inherit;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--code-text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
pre .copy:hover { background: rgba(255, 255, 255, 0.16); }
pre:hover .copy, pre .copy:focus { opacity: 1; }
@media (hover: none) { pre .copy { opacity: 1; } }

/* Code with curl / Node.js tabs: one dark card, tabs in its header bar */
.code-tabs {
    margin: 14px 0 18px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    box-shadow: var(--shadow-md);
}
.code-tabs pre { margin: 0; border: none; border-radius: 0; box-shadow: none; }
.tab-buttons {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    background: var(--code-bar);
    border-bottom: 1px solid var(--code-border);
}
.tab-buttons button {
    padding: 4px 12px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(232, 238, 225, 0.6);
    background: none;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tab-buttons button:hover { color: var(--code-text); }
.tab-buttons button.selected { color: var(--code-text); background: rgba(255, 255, 255, 0.1); }

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0 22px;
    font-size: 0.9rem;
    line-height: 1.55;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
th {
    text-align: left;
    padding: 11px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--subtle);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: top; }
tbody tr:first-child td { border-top: none; }
td:first-child { white-space: nowrap; }
td code.url:empty::before { content: "set in config.js"; color: var(--subtle); font-style: italic; }

/* Callouts */
.callout {
    margin: 18px 0;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #d7e6bd;
    background: var(--accent-soft);
}
.callout.important { border-color: var(--border-strong); background: var(--surface); box-shadow: inset 4px 0 0 var(--ink); }
.callout.waiting { border-color: #f3e2ad; background: var(--waiting-surface); box-shadow: inset 4px 0 0 var(--waiting); }

details {
    margin: 14px 0 18px;
    padding: 12px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
details[open] { padding-bottom: 6px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent-strong); }

ol.steps { padding-left: 22px; }
ol.steps li { margin-bottom: 8px; padding-left: 4px; }
ol.steps li::marker { color: var(--accent); font-weight: 700; }

ul.checklist { list-style: none; padding: 0; }
ul.checklist li { position: relative; padding: 8px 0 8px 32px; border-bottom: 1px solid var(--border); }
ul.checklist li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 13px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    border-radius: 5px;
}

.content-footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 0.88rem; }
.powered-by a { color: var(--ink); font-weight: 600; text-decoration: none; }
.powered-by a:hover { color: var(--accent-strong); }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content { padding: 28px 18px 56px; }
    .top-bar { padding: 0 16px; }
    .top-links { gap: 14px; }
    h1 { font-size: 1.9rem; }
    table { display: block; overflow-x: auto; }
    td:first-child { white-space: normal; }
}

/* Phones: the header keeps to one line and the page never runs wider than the screen. */
@media (max-width: 600px) {
    .badge, .top-links .button { display: none; }
    .top-links { gap: 12px; }
    .top-links a { font-size: 0.85rem; white-space: nowrap; }
    .brand { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
