/* Sail Hub Docs. Same colours and fonts as the rest of Sail Hub. */
:root {
    --bg: #0b0b0f;
    --panel: #111116;
    --panel-2: #16161d;
    --text: #fafafa;
    --body: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #a855f7;
    --accent-hover: #c084fc;
    --accent-soft: rgba(168, 85, 247, 0.12);
    --accent-rgb: 168, 85, 247;
    --code-bg: #0f0f14;
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
    --top-h: 60px;
    --side-w: 272px;
    --toc-w: 230px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); }
body { background: var(--bg); color: var(--text); font: 15px/1.65 'Inter', system-ui, sans-serif; min-height: 100vh; overflow-x: hidden; }
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.10), transparent 45%),
                radial-gradient(circle at 90% 90%, rgba(var(--accent-rgb), 0.05), transparent 40%);
}
h1, h2, h3, h4, .brand { font-family: 'Outfit', 'Inter', sans-serif; }
a { color: var(--accent-hover); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 600 11px/1 'Inter', sans-serif; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 300; padding: 8px 14px; background: var(--accent); color: #fff; border-radius: 8px; }
.skip:focus { left: 12px; }

/* ---- Top bar ---- */
.topbar {
    position: sticky; top: 0; z-index: 100; height: var(--top-h);
    display: flex; align-items: center; gap: 18px; padding: 0 20px;
    background: rgba(11, 11, 15, 0.85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.brand img { border-radius: 6px; object-fit: contain; }
.brand span { color: var(--accent); }
.product-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.product-tabs::-webkit-scrollbar { display: none; }
.product-tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.product-tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.product-tabs a.active { color: var(--text); background: var(--accent-soft); }
.search-btn {
    margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 8px 10px 8px 12px;
    border: 1px solid var(--border-strong); border-radius: 10px; background: rgba(255, 255, 255, 0.03); color: var(--muted);
    font: inherit; font-size: .9rem; cursor: pointer;
}
.search-btn:hover { border-color: rgba(var(--accent-rgb), 0.45); color: var(--text); }
/* The docs home has its own big search box, so the top bar doesn't need a second one. */
.home .topbar .search-btn { display: none; }
.home .topbar .search-btn + .top-link { margin-left: auto; }
.search-btn span { flex: 1; text-align: left; }
.top-link { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; }
.top-link:hover { color: var(--text); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); padding: 6px; border-radius: 8px; cursor: pointer; }

/* ---- Three columns ---- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1440px; margin: 0 auto; }
.sidebar {
    position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
    padding: 22px 16px 40px 20px; border-right: 1px solid var(--border);
}
.side-product { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.side-product img { border-radius: 7px; object-fit: cover; }
.side-product b { display: block; font-family: 'Outfit', sans-serif; font-size: 1.02rem; }
.side-product small { display: block; color: var(--faint); font-size: .78rem; line-height: 1.35; }
.side-group { margin-top: 14px; }
.side-switch { display: none; flex-wrap: wrap; gap: 6px; padding: 0 4px 14px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.side-switch a { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--muted); text-decoration: none; font-size: .84rem; }
.side-switch a.active { color: var(--text); border-color: rgba(var(--accent-rgb), 0.6); background: var(--accent-soft); }
.side-group h2 { font: 700 .72rem/1 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 10px 8px; }
.side-group ul { list-style: none; }
.side-group a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.side-group a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.side-group a.active { color: var(--accent-hover); background: var(--accent-soft); font-weight: 600; }
.side-out { display: block; margin-top: 18px; padding: 6px 10px; color: var(--faint); font-size: .86rem; text-decoration: none; }
.side-out + .side-out { margin-top: 0; }
.side-out:hover { color: var(--accent-hover); }

.content { min-width: 0; padding: 26px 48px 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-hover); }

.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 30px 20px 40px 8px; }
.toc h2 { font: 700 .72rem/1 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.toc ul { list-style: none; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .84rem; line-height: 1.4; }
.toc .toc-3 a { padding-left: 24px; font-size: .8rem; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-hover); border-left-color: var(--accent); }

/* ---- Article ---- */
.prose { max-width: 780px; }
.prose h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 10px; }
.prose .lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 22px; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 26px 0 8px; color: var(--text); }
.prose h2:first-of-type { border-top: 0; }
.anchor { margin-left: 8px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.prose p, .prose li { color: var(--body); }
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; margin-bottom: 4px; }
.prose strong { color: var(--text); }
.prose em { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.prose code { font: .86em/1.4 ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: #e9d5ff; overflow-wrap: anywhere; }
.prose pre { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 18px; }
.prose pre code { background: none; border: 0; padding: 0; color: #e4e4e7; font-size: .84rem; line-height: 1.6; overflow-wrap: normal; }
.copy-btn { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--muted); font: 600 .74rem 'Inter', sans-serif; cursor: pointer; opacity: 0; }
.prose pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); }
/* Screenshots: <figure class="shot"><a href="full"><img></a><figcaption></figcaption></figure> */
.shot { margin: 4px 0 22px; }
.shot a { display: block; border-radius: 10px; }
.prose .shot img, .prose td img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); cursor: zoom-in; }
.prose td img { box-shadow: none; }
.shot figcaption { margin-top: 8px; color: var(--faint); font-size: .84rem; text-align: center; }
.updated { margin-top: 28px; color: var(--faint); font-size: .8rem; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--body); }
.prose th { color: var(--text); background: rgba(255, 255, 255, 0.03); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* Callouts: <div class="note|tip|warn"><b>Title</b><p>…</p></div> */
.note, .tip, .warn { border: 1px solid; border-left-width: 4px; border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; background: rgba(255, 255, 255, 0.02); }
.note { border-color: rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.05); }
.tip { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.05); }
.warn { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.05); }
.note > b, .tip > b, .warn > b { display: block; margin-bottom: 4px; font-family: 'Outfit', sans-serif; font-size: 1rem; }
.note > b { color: var(--accent-hover); }
.tip > b { color: var(--good); }
.warn > b { color: var(--warn); }
.note p:last-child, .tip p:last-child, .warn p:last-child, .note ul:last-child, .tip ul:last-child, .warn ul:last-child { margin-bottom: 0; }

/* Steps: <ol class="steps"> */
.prose ol.steps { list-style: none; margin-left: 0; counter-reset: step; }
.prose ol.steps > li { position: relative; padding: 0 0 14px 44px; counter-increment: step; }
.prose ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--accent-hover); font: 700 .82rem 'Outfit', sans-serif; }
.prose ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--border-strong); }

/* Cards: <div class="cards"><a class="card" href>…</a></div> */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 20px; }
.card { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); text-decoration: none; color: var(--body); transition: border-color .15s, background .15s; }
.card:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.05); }
.card b { display: block; color: var(--text); font-family: 'Outfit', sans-serif; font-size: 1.02rem; margin-bottom: 2px; }
.card span { font-size: .88rem; color: var(--muted); }
.button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 9px; background: var(--accent); color: #fff !important; text-decoration: none; font-weight: 600; font-size: .92rem; box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.3); }
.button:hover { background: var(--accent-hover); }
.button.ghost { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-strong); box-shadow: none; color: var(--text) !important; }
.button.ghost:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }

.pagers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 780px; margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.pager { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; transition: border-color .15s; }
.pager:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.pager small { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: .8rem; }
.pager small svg { width: 14px; height: 14px; }
.pager b { color: var(--text); font-weight: 600; }
.pager.next { grid-column: 2; text-align: right; align-items: flex-end; }
.docs-footer { max-width: 780px; margin: 40px 0 0; padding: 22px 0 34px; border-top: 1px solid var(--border); color: var(--faint); font-size: .84rem; }
.docs-footer a { color: var(--muted); text-decoration: none; }
.docs-footer a:hover { color: var(--accent-hover); }

/* ---- Docs home ---- */
.home-main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.home-hero { text-align: center; padding: 70px 0 44px; }
.home-hero h1 { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.home-hero h1 span { color: var(--accent); }
.home-hero p { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 14px auto 26px; }
.search-btn.big { margin: 0 auto; min-width: 0; width: min(520px, 100%); padding: 12px 14px; font-size: 1rem; border-radius: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-bottom: 20px; }
@media (max-width: 760px) { .product-grid { grid-template-columns: 1fr; } }
.product-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(24, 24, 27, 0.45); }
.product-head { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); margin-bottom: 12px; }
.product-head img { border-radius: 12px; object-fit: cover; border: 1px solid rgba(var(--accent-rgb), 0.25); }
.product-head h2 { font-size: 1.3rem; }
.product-head p { color: var(--faint); font-size: .85rem; }
.product-head:hover h2 { color: var(--accent-hover); }
.product-sum { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.product-card ul { list-style: none; margin-bottom: 14px; flex: 1; }
.product-card li a { display: block; padding: 5px 0; color: var(--body); text-decoration: none; font-size: .93rem; border-bottom: 1px solid var(--border); }
.product-card li a:hover { color: var(--accent-hover); }
.product-all { color: var(--accent-hover); text-decoration: none; font-weight: 600; font-size: .9rem; }
.home .docs-footer { max-width: none; text-align: center; }

/* ---- Page not found ---- */
.lost { text-align: center; padding: 64px 0 40px; max-width: 620px; margin: 0 auto; }
.lost-sea { position: relative; height: 70px; margin-bottom: 4px; }
.lost-boat { display: inline-block; font-size: 2.6rem; animation: bob 3.2s ease-in-out infinite; }
.lost-waves { position: absolute; left: 0; right: 0; bottom: 0; color: rgba(var(--accent-rgb), 0.55); letter-spacing: .35em; font: 700 1.1rem/1 'Outfit', sans-serif; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(4deg); } }
.lost-face { font-size: 1.6rem; color: var(--muted); margin-bottom: 14px; }
.lost-code { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; font-size: .82rem; letter-spacing: .04em; margin-bottom: 14px; }
.lost h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 12px; }
.lost > p:not(.lost-face):not(.lost-code) { color: var(--muted); font-size: 1.05rem; margin-bottom: 26px; }
.lost-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.lost-home { color: var(--accent-hover); font-weight: 600; text-decoration: none; }
.lost-home:hover { text-decoration: underline; }
.lost-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lost-chips a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--body); text-decoration: none; font-size: .9rem; }
.lost-chips a:hover { border-color: rgba(var(--accent-rgb), 0.5); color: var(--text); }
.lost-chips img { border-radius: 5px; object-fit: cover; }
.lost-page .topbar .search-btn { display: none; }
@media (prefers-reduced-motion: reduce) { .lost-boat { animation: none; } }

/* ---- Search ---- */
.search-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 75vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 1.02rem; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; overflow-y: auto; padding: 6px; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--body); }
.search-results a .r-title { color: var(--text); font-weight: 600; }
.search-results a .r-where { color: var(--faint); font-size: .78rem; margin-left: 6px; }
.search-results a .r-text { display: block; color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results a mark { background: rgba(var(--accent-rgb), 0.3); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--accent-soft); }
.search-results .r-none { padding: 14px 12px; color: var(--muted); }
.search-hint { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--faint); font-size: .78rem; }

.scrim { position: fixed; inset: var(--top-h) 0 0; z-index: 80; background: rgba(0, 0, 0, 0.55); }
.scrim[hidden] { display: none; }

/* ---- Narrower screens ---- */
@media (max-width: 1180px) {
    .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
    .toc { display: none; }
}
@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .menu-btn { display: inline-flex; }
    .sidebar { position: fixed; z-index: 90; left: 0; top: var(--top-h); width: min(300px, 86vw); background: var(--panel); transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
    body.side-open .sidebar { transform: none; visibility: visible; }
    .product-tabs { display: none; }
    .side-switch { display: flex; }
    .content { padding: 20px 20px 0; }
    .search-btn { min-width: 0; }
    .search-btn span, .search-btn kbd { display: none; }
    .search-btn.big span { display: inline; }
    .top-link:not(.icon-only) { display: none; }
}
@media (max-width: 560px) {
    .topbar { gap: 10px; padding: 0 12px; }
    .content { padding: 16px 16px 0; }
    .prose h1 { font-size: 1.8rem; }
    .home-hero { padding: 44px 0 30px; }
    .home-hero h1 { font-size: 2.4rem; }
    .pagers { grid-template-columns: 1fr; }
    .pager.next { grid-column: 1; }
    .home-main { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
