/* Morphé Docs theme. Colours, type and spacing follow the landing page design system. */
:root {
  --ink: #141414;
  --ink-2: #3C3C3C;
  --ink-3: #5A5A5A;
  --line: #E4E4E4;
  --line-2: #C0C0C0;
  --wash: #F3F3F5;
  --wash-2: #FAFAFB;
  --bg: #FFFFFF;
  --link: #4A5CC4;
  --link-hover: #2F3E9E;
  --implicit: #697DE6;
  --coral: #DE6E79;
  --orange: #DF8E62;
  --grad: linear-gradient(90deg, #DF8E62, #DE6E79, #697DE6);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Archivo', 'Helvetica Neue', Helvetica, sans-serif;
  --header-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.65; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .88em; background: var(--wash); padding: 1px 5px; }
.px { image-rendering: pixelated; }
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--implicit); outline-offset: 2px; }

/* ---------------------------------------------------------------- site header */
.site-header { position: sticky; top: 0; z-index: 30; height: var(--header-h); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .inner { max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; display: block; }
.brand span { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding-left: 12px; border-left: 1px solid var(--line-2); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; position: relative; padding: 6px 0; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--grad); }
.site-nav .cta { padding: 10px 16px; background: var(--ink); color: #fff; font-weight: 600; }
.site-nav .cta:hover { color: #fff; background: #2a2a2a; }
.menu-btn { display: none; }

/* ---------------------------------------------------------------- layout */
.layout { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 0 56px; }
.sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 32px 8px 64px 0; overscroll-behavior: contain; scrollbar-width: thin; }
.main { display: grid; grid-template-columns: minmax(0, 780px) 220px; gap: 0 56px; border-left: 1px solid var(--line); padding-left: 56px; min-width: 0; }
.article { min-width: 0; padding: 48px 0 96px; display: flex; flex-direction: column; gap: 40px; }
.toc-col { padding: 56px 0 64px; }
.toc { position: sticky; top: calc(var(--header-h) + 32px); display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; }
.toc .label { padding-bottom: 8px; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--ink-3); text-decoration: none; border-left: 1px solid var(--line); }
.toc a:hover { color: var(--ink); border-left-color: #787878; }
.toc a.active { color: var(--ink); border-left-color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- sidebar nav */
.nav { display: flex; flex-direction: column; gap: 24px; font-size: 15px; line-height: 1.4; }
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-top .title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; font-stretch: 125%; letter-spacing: -.01em; }
.nav-top img { width: 32px; height: 32px; display: block; }
.version { font-family: var(--mono); font-size: 12px; color: var(--ink-3); border: 1px solid var(--line); padding: 3px 8px; }
.search { position: relative; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border: 1px solid var(--line-2); background: #fff; }
.search-box:focus-within { border-color: var(--implicit); box-shadow: 0 0 0 3px rgba(105,125,230,.18); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 15px; background: transparent; color: var(--ink); }
.search-box kbd { font-family: var(--mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); padding: 1px 5px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 12px 32px rgba(20,20,20,.12); max-height: 60vh; overflow-y: auto; display: none; }
.search-results.open { display: block; }
.nav .search-results a, .search-results a { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.nav .search-results a:last-child { border-bottom: 0; }
.nav .search-results a.sel, .nav .search-results a:hover { background: var(--wash); }
.search-results img { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.search-results .r-title { font-weight: 600; display: block; }
.search-results .r-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; }
.search-results .r-desc { font-size: 13px; color: var(--ink-2); display: block; line-height: 1.4; }
.search-results .empty { padding: 12px; font-size: 14px; color: var(--ink-3); }
.nav-group > .label { padding: 0 10px 6px; display: block; }
.nav a { display: block; padding: 6px 10px; color: var(--ink-2); text-decoration: none; border-radius: 4px; }
.nav a:hover { background: var(--wash); color: var(--ink); }
.nav a[aria-current="page"] { display: flex; align-items: center; gap: 8px; background: var(--wash); color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--grad); }
.nav details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 4px; font-weight: 600; color: var(--ink); }
.nav details > summary::-webkit-details-marker { display: none; }
.nav details > summary:hover { background: var(--wash); }
.nav summary .count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 400; }
.nav summary .chev { transition: transform .2s ease; }
.nav details[open] > summary .chev { transform: rotate(90deg); }
.nav .panel-items { display: flex; flex-direction: column; padding: 4px 0 8px 10px; border-left: 1px solid var(--line); margin-left: 10px; }
.nav .tier { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 2px; }

/* ---------------------------------------------------------------- article parts */
.crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--ink-3); }
.crumbs span:last-child { color: var(--ink); }
.page-head { display: flex; flex-direction: column; gap: 20px; }
.page-head .bar { width: 64px; height: 4px; background: var(--grad); }
.page-head h1 { margin: 0; font-size: 64px; line-height: 1; font-weight: 800; font-stretch: 125%; letter-spacing: -.03em; }
.lead { margin: 0; font-size: 21px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.comp-title { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.icon-tile { width: 80px; height: 80px; flex: none; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.icon-tile img { width: 48px; height: 48px; display: block; }
.comp-title h1 { font-size: 56px; }
.comp-title > div:last-child { flex: 1 1 360px; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.meta b { color: var(--ink); font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--chip, #787878); font-family: var(--mono); font-size: 12px; color: var(--ink); white-space: nowrap; line-height: 1.6; }
.chip::before { content: ""; width: 8px; height: 8px; background: var(--chip, #787878); flex: none; }
.chip.plain { border-color: var(--line); }
.chip.plain::before { display: none; }

.section { display: flex; flex-direction: column; gap: 20px; padding-top: 40px; border-top: 1px solid var(--line); }
.section > h2, .prose h2 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; font-stretch: 125%; letter-spacing: -.015em; }
.prose { display: flex; flex-direction: column; gap: 20px; }
.prose p { margin: 0; color: var(--ink-2); text-wrap: pretty; }
.prose h3 { margin: 8px 0 0; font-size: 19px; line-height: 1.3; font-weight: 700; }
.prose ul, .prose ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose pre { margin: 0; padding: 20px 24px; background: var(--ink); color: #F3F3F5; font-family: var(--mono); font-size: 14px; line-height: 1.7; overflow-x: auto; position: relative; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy-btn { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 11px; color: #C0C0C0; background: transparent; border: 1px solid #3C3C3C; padding: 4px 8px; cursor: pointer; min-height: 28px; }
.copy-btn:hover { color: #fff; border-color: #787878; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table.ref { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
table.ref th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.ref td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.ref tr:last-child td { border-bottom: 0; }
table.ref td.name { font-weight: 600; white-space: nowrap; }
table.ref td.mono { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
table.ref td.desc { color: var(--ink-2); min-width: 240px; }
table.ref .opt { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 400; padding-top: 2px; }
table.ref .acc { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 4px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.prose td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }

.msg { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border: 1px solid; }
.msg.Warning { color: #8A5A00; border-color: #E0B45A; background: #FFF8E8; }
.msg.Error { color: #A02634; border-color: #E59AA3; background: #FFF1F2; }

.callout { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--line); background: var(--wash-2); }
.callout .i { width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--implicit); color: var(--implicit); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.callout.warm .i { border-color: var(--orange); color: #B4683D; }
.callout .c { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.callout .c p { margin: 0; }

figure.fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
figure.fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
figure.fig figcaption { font-size: 14px; color: var(--ink-3); }
.fig-missing { width: 100%; border: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background-image: repeating-linear-gradient(135deg, rgba(120,120,120,.07) 0 10px, transparent 10px 20px); }

.comp-ref { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; vertical-align: -5px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.comp-ref:hover { color: var(--ink); border-bottom-color: var(--ink); }
.comp-ref img { width: 20px; height: 20px; display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .2s ease, transform .2s ease; }
a.card:hover { border-color: #787878; transform: translateY(-2px); color: var(--ink); }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card img { width: 32px; height: 32px; display: block; }
.card .t { font-weight: 700; font-size: 17px; }
.card .d { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.card .sw { width: 24px; height: 4px; }
.card.selected { border-color: var(--ink); }

.steps { display: flex; flex-direction: column; gap: 24px; counter-reset: step; }
.step { display: flex; gap: 20px; }
.step .n { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 500; }
.step .b { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; min-width: 0; }
.step h3 { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 700; }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr)); gap: 12px; padding: 24px; border: 1px solid var(--line); background-image: radial-gradient(rgba(120,120,120,.22) 1px, transparent 1.2px); background-size: 24px 24px; }
.flow .node { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line-2); background: #fff; min-width: 0; text-decoration: none; color: var(--ink); }
.flow .node img { width: 32px; height: 32px; display: block; }
.flow .node .t { font-weight: 700; font-size: 15px; line-height: 1.25; }
.flow .node .d { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--ink-3); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 13px; }
.pills span { padding: 6px 10px; border: 1px solid var(--line); }

.prevnext { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; padding-top: 40px; border-top: 1px solid var(--line); }
.prevnext a { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .2s ease; }
.prevnext a:hover { border-color: #787878; color: var(--ink); }
.prevnext a.next { align-items: flex-end; text-align: right; }
.prevnext .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.page-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.site-footer { border-top: 1px solid var(--line); }
.site-footer .inner { max-width: 1440px; margin: 0 auto; padding: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.site-footer a { color: var(--ink-3); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .toc-col { display: none; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .site-header .inner, .layout { padding: 0 16px; }
  .brand img { height: 32px; }
  .brand span { display: none; }
  .site-nav { display: none; }
  .site-nav.open { display: flex; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav.open a[aria-current="page"]::after { display: none; }
  .site-nav.open .cta { text-align: center; margin-top: 12px; border-bottom: 0; }
  .menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 16px 0 0; }
  .nav-browse { display: block; }
  .sidebar .nav-body { display: none; }
  .sidebar.open .nav-body { display: flex; }
  .main { border-left: 0; padding-left: 0; }
  .article { padding-top: 24px; }
  .page-head h1 { font-size: 44px; }
  .comp-title h1 { font-size: 40px; }
  .lead { font-size: 19px; }
}
.nav-browse { display: none; width: 100%; min-height: 44px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: 15px; font-weight: 600; text-align: left; padding: 0 12px; cursor: pointer; }
.nav-body { display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 900px) { .nav-browse { display: flex; align-items: center; justify-content: space-between; } .nav { gap: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 900px) { .search-box kbd { display: none; } }
.nav-browse .chev { transition: transform .2s ease; } .nav-browse[aria-expanded="true"] .chev { transform: rotate(90deg); }

/* example definition download */
.def-card { border: 1px solid var(--line); display: flex; flex-direction: column; }
.def-head { display: flex; gap: 16px; padding: 20px; align-items: flex-start; }
.def-badge { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--grad); color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.def-head .t { font-weight: 700; font-size: 18px; line-height: 1.3; }
.def-head .d { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-top: 4px; }
.def-try { padding: 0 20px 16px 80px; }
.def-try ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--ink-2); }
.def-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--wash-2); }
.def-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.def-btn:hover { background: #2a2a2a; color: #fff; }
@media (max-width: 900px) { .def-try { padding-left: 20px; } }
code, pre, kbd, .mono, .label, table.ref td.mono { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
