/* FlowForge documentation. Plain CSS, no build step. */
:root {
    --paper: #ffffff;
    --side: #f7f8fa;
    --sunk: #f1f3f5;
    --ink: #15181d;
    --ink-2: #454d5a;
    --muted: #6b7380;
    --line: #e3e6ea;
    --brand: #ee5a24;
    --brand-soft: #fdf0ea;
    --link: #c2410c;
    --ok: #15803d;
    --ok-soft: #ecf8f0;
    --warn: #a15c07;
    --warn-soft: #fdf6e7;
    --info-soft: #eef4fd;
    --info: #1d4ed8;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .08);
    --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --top: 60px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #101216; --side: #14171c; --sunk: #1b1f26; --ink: #e9ebee; --ink-2: #b8bec8; --muted: #8b93a0;
        --line: #272c34; --brand: #f26b3a; --brand-soft: #2a1a13; --link: #ff8f62; --ok: #4ade80; --ok-soft: #12261a;
        --warn: #f5b84a; --warn-soft: #2a2112; --info-soft: #131d2e; --info: #8ab4ff; --shadow: 0 8px 24px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --paper: #101216; --side: #14171c; --sunk: #1b1f26; --ink: #e9ebee; --ink-2: #b8bec8; --muted: #8b93a0;
    --line: #272c34; --brand: #f26b3a; --brand-soft: #2a1a13; --link: #ff8f62; --ok: #4ade80; --ok-soft: #12261a;
    --warn: #f5b84a; --warn-soft: #2a2112; --info-soft: #131d2e; --info: #8ab4ff; --shadow: 0 8px 24px rgba(0, 0, 0, .4);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--font); }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px;
    padding: 0 20px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: 14px; }
.version { font: 500 12px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.search { position: relative; margin-left: auto; width: min(340px, 40vw); }
.search input { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--side); color: var(--ink);
    border-radius: 9px; padding: 0 12px 0 36px; font: inherit; font-size: 14px; }
.search input:focus { outline: none; border-color: var(--brand); background: var(--paper); }
.search > svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 8px; font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--paper); }
.results { position: absolute; top: 44px; left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow); max-height: 60vh; overflow: auto; padding: 6px; display: none; }
.results.open { display: block; }
.results a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 14px; }
.results a span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.results a:hover, .results a.active { background: var(--sunk); }
.results p { margin: 8px 10px; color: var(--muted); font-size: 14px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper);
    border-radius: 9px; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--sunk); }
.icon-btn svg { width: 18px; height: 18px; }
.support-link { white-space: nowrap; font-size: 14px; font-weight: 500; text-decoration: none; color: #fff; background: var(--brand);
    padding: 8px 14px; border-radius: 9px; }
.support-link:hover { filter: brightness(1.05); }
.menu-btn { display: none; }
.theme-dark, :root[data-theme="dark"] .theme-light { display: none; }
:root[data-theme="dark"] .theme-dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-light { display: none; }
    :root:not([data-theme="light"]) .theme-dark { display: block; }
}

/* Layout */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.side { position: sticky; top: var(--top); height: calc(100dvh - var(--top)); overflow-y: auto; background: var(--side);
    border-right: 1px solid var(--line); padding: 22px 14px 40px; }
.side h4 { margin: 18px 10px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.side a:hover { background: var(--sunk); color: var(--ink); }
.side a.active { background: var(--brand-soft); color: var(--link); font-weight: 500; }
main { padding: 48px clamp(20px, 5vw, 72px) 96px; }
.doc { max-width: 47rem; }

/* Type */
h1, h2, h3 { letter-spacing: -.022em; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(32px, 5vw, 44px); margin: 0 0 14px; letter-spacing: -.035em; line-height: 1.08; }
h2 { font-size: 28px; margin: 80px 0 14px; padding-top: 28px; border-top: 1px solid var(--line); }
h3 { font-size: 19px; margin: 36px 0 10px; }
h2 a.anchor, h3 a.anchor { color: var(--muted); text-decoration: none; margin-left: 8px; opacity: 0; font-weight: 400; }
h2:hover a.anchor, h3:hover a.anchor { opacity: 1; }
p, li { color: var(--ink-2); }
strong { color: var(--ink); font-weight: 600; }
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0 0 28px; max-width: 40rem; }
ul, ol { padding-left: 22px; }
li { margin: 5px 0; }
li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Inline bits */
code { font: 500 .86em var(--mono); background: var(--sunk); border: 1px solid var(--line); border-radius: 5px; padding: .1em .38em; color: var(--ink); overflow-wrap: anywhere; }
.path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; vertical-align: baseline; }
.path b { font-weight: 600; font-size: .92em; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
    border-bottom-width: 2px; border-radius: 6px; padding: 0 7px; white-space: nowrap; }
.path i { font-style: normal; color: var(--muted); font-size: .9em; }
.path i::before { content: "›"; }

/* Code blocks */
.code { position: relative; margin: 14px 0 20px; }
.code pre { margin: 0; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; padding-right: 76px;
    overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--ink); white-space: pre; }
.code pre code { background: none; border: 0; padding: 0; font: inherit; overflow-wrap: normal; }
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 7px;
    font-size: 12.5px; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.copy:hover { color: var(--ink); }
.copy.done { color: var(--ok); border-color: var(--ok); }

/* Steps: a real sequence, so numbered */
ol.steps { list-style: none; padding: 0; counter-reset: s; margin: 18px 0 24px; }
ol.steps > li { counter-increment: s; position: relative; padding: 3px 0 18px 46px; margin: 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; font: 600 14px var(--font); color: var(--link); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
ol.steps > li::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
ol.steps > li:last-child::after { display: none; }

/* Callouts */
.note { border: 1px solid var(--line); border-left: 3px solid var(--muted); background: var(--side); border-radius: 8px; padding: 12px 16px; margin: 18px 0; }
.note p { margin: 4px 0; }
.note.tip { border-left-color: var(--ok); background: var(--ok-soft); }
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.note.info { border-left-color: var(--info); background: var(--info-soft); }

/* Figures */
figure { margin: 20px 0 28px; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: zoom-in; background: var(--side); }
figure video { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: #0d0f13; }
figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.phones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0 28px; }
.phones figure { margin: 0; }
.phones img { border-radius: 16px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pair figure { margin: 0 0 12px; }

/* Tables */
.table { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
th { font-weight: 600; color: var(--ink); background: var(--side); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child code { white-space: nowrap; overflow-wrap: normal; }

/* Hero */
.hero-shot { margin: 8px 0 36px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 32px; }
.facts div { padding: 14px 16px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.facts span { font-size: 13.5px; color: var(--muted); line-height: 1.35; display: block; }
.panel-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.panel-tabs a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--paper); }
.panel-tabs a:hover { border-color: var(--brand); color: var(--link); }
.offer { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-soft); border-radius: 12px; padding: 18px 20px; margin: 20px 0; }
.offer h3 { margin-top: 0; }
.offer p:last-child { margin-bottom: 0; }

footer.doc-foot { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* Lightbox */
dialog.zoom { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.zoom::backdrop { background: rgba(10, 12, 16, .82); }
dialog.zoom img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 8px; cursor: zoom-out; }

/* Phones and tablets */
@media (max-width: 1023px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .menu-btn { display: grid; }
    .side { position: fixed; z-index: 40; top: var(--top); left: 0; width: min(300px, 86vw); transform: translateX(-102%);
        transition: transform .2s ease; box-shadow: var(--shadow); }
    body.nav-open .side { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(10, 12, 16, .35); z-index: 35; }
    .support-link { display: none; }
}
@media (max-width: 640px) {
    .top { padding: 0 16px; gap: 8px; }
    .brand small, .version, .search kbd { display: none; }
    .search { width: auto; flex: 1; }
    main { padding: 32px 16px 80px; }
    h2 { font-size: 24px; margin-top: 60px; }
    .lede { font-size: 17px; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts div:nth-child(2) { border-right: 0; }
    .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pair { grid-template-columns: minmax(0, 1fr); }
    ol.steps > li { padding-left: 40px; }
}
@media print {
    .top, .side { display: none; }
    .shell { display: block; }
    h2 { break-before: page; }
}
