/* BluePenguin Docs */
@font-face { font-family: "Inter"; src: url("/home/assets/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff; --side: #fbfcfd; --ink: #0f1b2d; --text: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e6eaf0; --line-2: #eef1f5; --accent: var(--brand-blue-text); --accent-ink: var(--brand-blue-pressed); --accent-soft: var(--brand-blue-soft);
  --code-bg: #0e1626; --code-ink: #e2e8f0; --code-line: #1f2a3d; --inline: #f1f4f8;
  --code-muted: #8b9ab0; --code-comment: #6b7a90; --search-overlay: #0a111d80; --nav-overlay: #0a111d66;
  --tip: #0f8a52; --tip-soft: #ecf8f1; --warn: #b45309; --warn-soft: #fff7ea; --note-soft: #f3f7fe;
  --get: #0f8a52; --post: var(--brand-blue); --patch: #b45309; --del: #c2352b;
  --shadow: 0 12px 40px #0f1b2d1f;
  color-scheme: light;
}
/* Light by default (like the app); the toggle switches to dark. */
:root[data-theme="dark"] {
  --bg: #000000; --side: #0d0d0d; --ink: #f5f5f5; --text: #d4d4d4; --muted: #a3a3a3; --faint: #808080;
  --line: #292929; --line-2: #1a1a1a; --accent: var(--brand-blue-light); --accent-ink: var(--brand-blue-light); --accent-soft: #171717;
  --code-bg: #0a0a0a; --code-ink: #e5e5e5; --code-line: #262626; --inline: #1a1a1a;
  --code-muted: #a3a3a3; --code-comment: #8a8a8a; --search-overlay: #00000080; --nav-overlay: #00000066;
  --tip: #4fd08f; --tip-soft: #0f2a1f; --warn: #f5b454; --warn-soft: #2b2112; --note-soft: #101010;
  --get: #4fd08f; --post: var(--brand-blue-light); --patch: #f5b454; --del: #ff7b6e; --shadow: 0 12px 40px #0008;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 120px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-soft); color: var(--ink); }
input { caret-color: var(--accent); }
.side, .search-res, .table, .code pre { scrollbar-width: thin; scrollbar-color: var(--muted) var(--bg); }
code, kbd, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 0; background: var(--ink); color: var(--bg); }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-wordmark { display: block; width: 170px; flex: none; }
.brand img { display: block; width: 100%; height: auto; }
.brand .brand-wordmark-dark, .brand .brand-symbol { display: none; }
:root[data-theme="dark"] .brand-wordmark-light { display: none; }
:root[data-theme="dark"] .brand-wordmark-dark { display: block; }
.brand em { margin-left: 2px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 500 12px/1.5 Inter, sans-serif; font-style: normal; }
.search-btn { display: flex; align-items: center; gap: 10px; width: min(380px, 34vw); height: 38px; margin: 0 auto; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--side); color: var(--muted); font: 400 14px Inter, sans-serif; cursor: pointer; transition: border-color .15s; }
.search-btn:hover { border-color: var(--faint); }
.search-btn span { flex: 1; text-align: left; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 11px; }
.top-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--ink); }
.top-links .cta { padding: 7px 14px; border-radius: 9px; background: var(--ink); color: var(--bg); font-weight: 500; }
.top-links .cta:hover { color: var(--bg); opacity: .9; }
.theme-btn, .menu-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.theme-btn:hover { color: var(--ink); }
.menu-btn { display: none; }

.tabs { position: sticky; top: 60px; z-index: 29; display: flex; gap: 24px; height: 44px; padding: 0 24px; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs a { display: flex; align-items: center; flex: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { border-color: var(--accent); color: var(--ink); }

/* ---------- three columns ---------- */
.scrim { display: none; }
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; max-width: 1440px; margin: 0 auto; }
.side { position: sticky; top: 104px; align-self: start; height: calc(100vh - 104px); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line-2); scrollbar-width: thin; }
.nav-sec { margin-bottom: 22px; }
.nav-sec p { margin: 0 0 6px 10px; color: var(--ink); font-size: 13px; font-weight: 600; }
.nav-sec a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.nav-sec a:hover { background: var(--line-2); color: var(--ink); }
.nav-sec a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.m { flex: none; min-width: 38px; padding: 1px 5px; border-radius: 5px; font: 600 10px/1.6 ui-monospace, monospace; letter-spacing: .02em; text-align: center; }
.m-get { background: color-mix(in srgb, var(--get) 14%, transparent); color: var(--get); }
.m-post { background: color-mix(in srgb, var(--post) 14%, transparent); color: var(--post); }
.m-patch { background: color-mix(in srgb, var(--patch) 16%, transparent); color: var(--patch); }
.m-delete { background: color-mix(in srgb, var(--del) 14%, transparent); color: var(--del); }

.doc { min-width: 0; max-width: 820px; padding: 40px 56px 40px; }
.crumb { margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 500; }
.doc h1 { margin: 0; color: var(--ink); font-size: 34px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.lead { margin: 12px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.endpoint { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--side); }
.endpoint .m { font-size: 11px; }
.endpoint code { color: var(--ink); font-size: 14px; }

.prose { margin-top: 28px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { position: relative; margin: 44px 0 12px; color: var(--ink); font-size: 22px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.prose h3 { position: relative; margin: 28px 0 8px; color: var(--ink); font-size: 17px; font-weight: 600; }
.anchor { position: absolute; left: -22px; color: var(--muted); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose :not(pre) > code { padding: 2px 6px; border-radius: 0; background: var(--inline); color: var(--ink); font-size: .86em; }

/* ---------- code ---------- */
.code { margin: 0 0 22px; border: 1px solid var(--code-line); border-radius: 0; background: var(--code-bg); overflow: hidden; }
.code-h { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--code-line); color: var(--code-muted); font-size: 12.5px; }
.code-h > span { flex: 1; }
.code-h button { border: 0; border-radius: 0; background: none; padding: 5px 10px; color: var(--code-muted); font: 500 12.5px Inter, sans-serif; cursor: pointer; }
.code-h button:hover { color: var(--code-ink); background: #ffffff0f; }
.code-h [data-copy] { margin-left: auto; }
.code-tablist { display: flex; align-items: center; gap: 4px; }
.code-h [role="tab"][aria-selected="true"] { color: #fff; background: #ffffff14; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-ink); font-size: 13px; line-height: 1.65; tab-size: 2; }
.code pre[hidden] { display: none; }
.code i { font-style: normal; }
.code .s { color: #a5e3a1; } .code .p { color: #9cc9ff; } .code .k { color: #d8a6ff; } .code .n { color: #ffb86b; } .code .c { color: var(--code-comment); }

/* ---------- blocks ---------- */
.callout { display: grid; gap: 2px; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-left: 1px solid var(--accent); border-radius: 0; background: var(--note-soft); font-size: 14.5px; }
.callout strong { color: var(--ink); font-size: 13.5px; }
.callout div > :last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--tip); background: var(--tip-soft); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }

.cards { display: grid; gap: 12px; margin: 0 0 24px; }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prose .card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.prose .card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 6px 20px #0f1b2d0f; transform: translateY(-1px); color: var(--text); }
.card strong { color: var(--ink); font-size: 15px; }
.card > span:last-child { color: var(--muted); font-size: 14px; line-height: 1.55; }
.card .tag { align-self: flex-start; margin-bottom: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 500; }

.steps { counter-reset: step; list-style: none; margin: 0 0 24px; padding: 0 !important; }
.steps > li { position: relative; margin: 0; padding: 0 0 8px 46px; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: var(--side); color: var(--ink); font-size: 13px; font-weight: 600; }
.steps > li::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 2px 0 8px !important; }

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

.fields { margin: 0 0 22px; border-top: 1px solid var(--line); }
.fields > div { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.fields dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fields dt code { color: var(--ink) !important; background: none !important; padding: 0 !important; font-size: 14px !important; font-weight: 600; }
.fields .ft { color: var(--muted); font: 12.5px ui-monospace, monospace; }
.fields .req { color: var(--del); font-size: 12px; font-weight: 500; }
.fields .def { padding: 0 7px; border-radius: 0; background: var(--inline); color: var(--muted); font: 12px ui-monospace, monospace; }
.fields dd { margin: 4px 0 0; color: var(--text); font-size: 14px; }
.range { color: var(--faint); font-size: 12.5px; }
.fields details { margin-top: 8px; }
.fields summary { width: fit-content; padding: 2px 10px; border: 1px solid var(--line); border-radius: 0; color: var(--muted); font-size: 12.5px; cursor: pointer; list-style: none; }
.fields summary::-webkit-details-marker { display: none; }
.fields details[open] summary { margin-bottom: 4px; }
.fields.nested { margin: 4px 0 0 4px; padding-left: 14px; border-top: 0; border-left: 1px solid var(--line); }

.endpoints { display: grid; gap: 8px; margin-bottom: 20px; }
.prose .endpoints a { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 0; color: var(--text); text-decoration: none; }
.prose .endpoints a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.endpoints code { color: var(--ink); font-size: 13.5px; }
.endpoints span:last-child { color: var(--muted); font-size: 14px; text-align: right; }

/* ---------- pager, footer ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pn { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; }
.pn strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.pn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--muted); }
.pn.next { text-align: right; }
.foot { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

/* ---------- on this page ---------- */
.toc { position: sticky; top: 104px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; padding: 40px 20px 20px 8px; font-size: 13px; }
.toc p { margin: 0 0 10px; color: var(--ink); font-weight: 600; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--muted); line-height: 1.4; }
.toc a.l3 { padding-left: 24px; }
.toc a:hover { color: var(--ink); }
.toc a.on { border-color: var(--accent); color: var(--accent); }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: transparent; color: var(--text); }
.search:not([open]) { display: none; }
.search::backdrop { background: var(--search-overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html:has(.search[open]) { overflow: hidden; }
.search-box { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-in input { flex: 1; min-width: 0; height: 54px; border: 0; background: none; color: var(--ink); font: 400 16px Inter, sans-serif; }
.search-in input:focus-visible { outline-offset: -4px; border-radius: 6px; }
.search-close { flex: none; min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.search-close:hover { color: var(--ink); background: var(--accent-soft); }
.search-in input::-webkit-search-cancel-button { display: none; }
.search-res { overflow-y: auto; padding: 8px; }
.search-res a { display: block; padding: 10px 12px; border-radius: 0; color: var(--text); }
.search-res a strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.search-res a span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.search-res a small { color: var(--accent); font-size: 12px; }
.search-res a.sel, .search-res a:hover { background: var(--accent-soft); }
.search-res mark { background: none; color: var(--accent); font-weight: 600; }
.search-res .empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 14px; }
.search-res [data-search-retry] { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .shell { grid-template-columns: 252px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .shell { display: block; }
  .menu-btn { display: grid; }
  .side { position: fixed; top: 104px; left: 0; bottom: 0; z-index: 50; width: min(300px, 86vw); height: calc(100dvh - 104px); padding-top: 20px; background: var(--bg); border-right: 1px solid var(--line);
    visibility: hidden; transform: translateX(-102%); transition: transform .2s ease, visibility .2s; box-shadow: var(--shadow); }
  body.nav-open .side { visibility: visible; transform: none; }
  body.nav-open { overflow: hidden; }
  .nav-sec a { min-height: 44px; }
  .scrim { display: block; position: fixed; inset: 104px 0 0; z-index: 45; background: var(--nav-overlay); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .doc { padding: 28px 16px 32px; }
  .doc h1 { font-size: 28px; }
  .top { gap: 10px; padding: 0 12px; }
  .search-btn { flex: none; width: 44px; height: 44px; margin: 0 0 0 auto; padding: 0; justify-content: center; }
  .menu-btn, .theme-btn { flex: none; width: 44px; height: 44px; }
  .search-btn span, .search-btn kbd, .top-links a:not(.cta) { display: none; }
  .top-links { gap: 8px; }
  .top-links .cta { display: flex; align-items: center; min-height: 44px; padding: 6px 11px; font-size: 13px; }
  .tabs { padding: 0 16px; gap: 20px; }
  .cards.c2, .cards.c3 { grid-template-columns: 1fr; }
  .anchor { display: none; }
  .endpoints span:last-child { display: none; }
  .prose .endpoints a { grid-template-columns: auto 1fr; }
}
@media (max-width: 420px) {
  .brand-wordmark { display: none; }
  .brand .brand-symbol { display: block; width: 36px; flex: none; }
}
@media (max-width: 359px) { .tabs-code .code-h { flex-wrap: wrap; padding-block: 4px; } .code-tablist { flex-basis: 100%; justify-content: space-between; } .top { gap: 6px; padding-inline: 8px; } .brand em { display: none; } .top-links { gap: 4px; } .top-links .cta { padding-inline: 8px; font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- questions ---------- */
.faq { margin: 0 0 24px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 2px; color: var(--ink); font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 2px 14px; }
.faq details > div > :last-child { margin-bottom: 0; }
.steps.plain > li { padding-bottom: 6px; }
.steps.plain > li::before { top: -2px; }
.steps.plain > li > p { margin-bottom: 14px; }
