/* MoxKit Docs — single stylesheet, no external fonts. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --bg-muted: #eef2f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --accent: #1a56db;
  --accent-2: #04a2a8;
  --accent-soft: #e8efff;
  --accent-ink: #ffffff;
  --warn-bg: #fff7e6; --warn-line: #f5b84a;
  --info-bg: #eaf6f6; --info-line: #04a2a8;
  --code-bg: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --top: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --bg-soft: #0f172a; --bg-muted: #172036; --ink: #e5eaf3; --ink-2: #c3cad8; --ink-3: #8e99ad; --line: #1f2a40;
    --accent: #6c9bff; --accent-2: #2fd0d6; --accent-soft: #15234a; --accent-ink: #0b1120;
    --warn-bg: #2a2110; --warn-line: #a57a26; --info-bg: #0f2a2c; --info-line: #2fa9ad; --code-bg: #141d31;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --bg-soft: #0f172a; --bg-muted: #172036; --ink: #e5eaf3; --ink-2: #c3cad8; --ink-3: #8e99ad; --line: #1f2a40;
  --accent: #6c9bff; --accent-2: #2fd0d6; --accent-soft: #15234a; --accent-ink: #0b1120;
  --warn-bg: #2a2110; --warn-line: #a57a26; --info-bg: #0f2a2c; --info-line: #2fa9ad; --code-bg: #141d31;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink-2); font: 16px/1.7 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; letter-spacing: -.01em; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: .12em .4em; border-radius: 6px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 10px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 700; }
.menu-btn, .theme-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink-2); cursor: pointer; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: 12px; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 44px 0 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--ink); font: inherit; font-size: 15px; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd { position: absolute; right: 10px; font-size: 12px; color: var(--ink-3); border: 1px solid var(--line); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.search-results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.search-results a b { display: block; color: var(--ink); font-weight: 600; }
.search-results a small { color: var(--ink-3); font-size: 13px; line-height: 1.45; display: block; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--accent-soft); }
.search-results .empty { padding: 12px; color: var(--ink-3); font-size: 14px; }
.top-links { display: flex; gap: 4px; margin-left: auto; }
.top-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.top-links a:hover { background: var(--bg-muted); color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; }
.dl { min-height: 40px; white-space: nowrap; }

/* Layout */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 240px; max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); }
.side-nav details { margin-bottom: 6px; }
.side-nav summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .2s; }
.side-nav details[open] > summary::after { transform: rotate(45deg); }
.side-nav ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 6px; }
.side-nav li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.4; border-left: 2px solid transparent; }
.side-nav li a:hover { background: var(--bg-muted); color: var(--ink); }
.side-nav li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-left-color: var(--accent); border-radius: 0 8px 8px 0; }

.content { min-width: 0; padding: 28px 48px 64px; }
.content article { max-width: 860px; margin: 0 auto; }
.content.home article { max-width: 1040px; }
.toc-rail { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 18px 40px 6px; font-size: 14px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }
.toc-rail ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc-rail li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; color: var(--ink-3); text-decoration: none; line-height: 1.45; border-left: 2px solid transparent; }
.toc-rail li a:hover { color: var(--ink); }
.toc-rail li a.active { color: var(--accent); border-left-color: var(--accent); }

/* Article */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: 14px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.article-head h1 { font-size: clamp(30px, 4vw, 42px); margin: 0 0 10px; }
.updated { margin: 0 0 22px; font-size: 14px; color: var(--ink-3); }
.lead { font-size: 19px; line-height: 1.65; color: var(--ink-2); }
article h2 { font-size: 27px; margin: 52px 0 14px; padding-top: 6px; }
article h3 { font-size: 20px; margin: 34px 0 10px; }
article p { margin: 0 0 16px; }
article ul, article ol { padding-left: 1.3em; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 0 0 26px; }
.facts li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 14px; color: var(--ink-2); }
.facts strong { color: var(--ink-3); font-weight: 600; margin-right: 6px; }
ul.ticks { list-style: none; padding-left: 0; }
ul.ticks li { position: relative; padding-left: 30px; margin: 0 0 10px; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: .42em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231a56db' d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6L20.1 8.4 18.7 7z'/%3E%3C/svg%3E") center/13px no-repeat; }
ol.steps { list-style: none; counter-reset: s; padding-left: 0; }
ol.steps li { counter-increment: s; position: relative; padding: 2px 0 14px 46px; }
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;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 700; font-size: 14px; }
ol.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }

figure.shot { margin: 26px 0 30px; }
figure.shot img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--bg-soft); cursor: zoom-in; }
figure.shot.narrow img { width: auto; max-width: 100%; max-height: 640px; margin: 0 auto; }
figure.shot figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-3); text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; }
.gallery figure.shot { margin: 10px 0; }

.toc-inline { margin: 6px 0 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); padding: 4px 18px; }
.toc-inline summary { cursor: pointer; font-weight: 700; color: var(--ink); padding: 10px 0; }
.toc-inline ol { margin: 0 0 12px; padding-left: 1.2em; columns: 2; column-gap: 28px; font-size: 15px; }
.toc-inline li { break-inside: avoid; margin-bottom: 4px; }

.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 12px; }
table.settings { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
table.settings th, table.settings td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.settings thead th { background: var(--bg-muted); color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
table.settings tbody th { color: var(--ink); font-weight: 600; width: 32%; }
table.settings td:nth-child(2) { width: 14%; color: var(--ink-3); white-space: nowrap; }
table.settings tr:last-child th, table.settings tr:last-child td { border-bottom: 0; }
table.settings tr.sub th { background: var(--bg-soft); color: var(--ink-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.dev { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 18px; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); white-space: nowrap; }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--info-line); background: var(--info-bg); border-radius: 10px; padding: 14px 18px; margin: 0 0 22px; }
.callout.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.callout p { margin: 0; }

.faq details { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--bg); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 48px 14px 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 17px; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 18px 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 26px; }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; color: var(--ink-2); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card .thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--bg-soft); margin: -4px -4px 6px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.card-title { color: var(--ink); font-weight: 700; font-size: 16px; }
.card-text { font-size: 14px; line-height: 1.5; color: var(--ink-3); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 860px; margin: 56px auto 0; }
.pager a { display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a span { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.pager .next { text-align: right; }
.pager a:hover { border-color: var(--accent); }

ul.changes { list-style: none; padding: 0; }
ul.changes li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tag { display: inline-block; min-width: 76px; text-align: center; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tag-new { background: #e3f6ec; color: #0f7a43; } .tag-fixed { background: #fdecec; color: #b42318; } .tag-improved { background: #e8efff; color: #1a56db; }
.tag-changed { background: #fff3dc; color: #a15c07; } .tag-security { background: #f1e8ff; color: #6b2fd6; }
:root[data-theme="dark"] .tag { filter: brightness(.9) saturate(1.2); }

/* Home */
.hero { padding: 26px 0 8px; }
.eyebrow { color: var(--accent-2); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); margin: 0 0 16px; background: linear-gradient(120deg, var(--ink) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { max-width: 780px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 26px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; list-style: none; padding: 0 !important; margin: 0 0 28px; }
.stats li { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg-soft); }
.stats b { display: block; font-size: 28px; color: var(--ink); line-height: 1.2; }
.stats span { font-size: 14px; color: var(--ink-3); }
.hero-shots { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.hero-shot img { display: block; width: 100%; height: 220px; object-fit: cover; object-position: top left; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 40px 20px 26px; margin-top: 40px; }
.foot-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.foot-inner p { font-size: 14px; color: var(--ink-3); }
.foot-inner a:not(.brand) { display: block; color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 3px 0; }
.foot-inner a:not(.brand):hover { color: var(--accent); }
.foot-title { font-weight: 700; color: var(--ink) !important; margin: 4px 0 8px; }
.legal { max-width: 1200px; margin: 26px auto 0; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 18px; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 10, 20, .86); display: grid; place-items: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; cursor: pointer; }

/* Responsive */
@media (max-width: 1279px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .toc-rail { display: none; }
}
@media (max-width: 1100px) { .top-links { display: none; } .search { margin-left: auto; } }
@media (max-width: 900px) {
  .layout { display: block; }
  .menu-btn { display: inline-grid; }
  .sidebar { position: fixed; z-index: 60; top: var(--top); left: 0; bottom: 0; width: min(86vw, 320px); height: auto; background: var(--bg); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(5, 10, 20, .45); z-index: 50; }
  .content { padding: 22px 16px 48px; }
  .toc-inline ol { columns: 1; }
  .hero-shots { grid-template-columns: 1fr; } .hero-shot:not(:first-child) { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  table.settings tbody th { width: auto; min-width: 140px; }
}
@media (max-width: 620px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand span { display: none; }
  .dl { display: none; }
  .search { margin-left: 4px; }
  .search kbd { display: none; }
  .lead { font-size: 17px; }
  article h2 { font-size: 23px; }
  .pager { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .topbar, .sidebar, .toc-rail, .pager, .site-footer { display: none; } .layout { display: block; } }
