/* Sortfully docs — layout shell. Brand tokens come from landing.css; prose from legal.css. */
:root { --docs-side: 264px; --docs-top: 60px; }

.docs-top {
  position: sticky; top: 0; z-index: 40; height: var(--docs-top);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.docs-top .brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 700; }
.docs-top .brand-mark img { display: block; border-radius: 7px; }
.docs-top .brand-name b { color: var(--accent); }
.docs-tag { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; vertical-align: 2px; }
.docs-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.docs-toplink { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 600; }
.docs-toplink:hover { color: var(--ink); }
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.docs-burger { display: none; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; }
.docs-burger svg { width: 20px; height: 20px; }

.docs-shell { display: grid; grid-template-columns: var(--docs-side) 1fr; align-items: start; max-width: var(--maxw); margin: 0 auto; }

.docs-sidebar {
  position: sticky; top: var(--docs-top); align-self: start;
  height: calc(100vh - var(--docs-top)); overflow-y: auto;
  padding: 26px 14px 40px 24px; border-right: 1px solid var(--border);
}
.docs-navgroup { margin-bottom: 22px; }
.docs-navlabel { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px 10px; }
.docs-navlink { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.35; }
.docs-navlink:hover { background: var(--surface-2); color: var(--ink); }
.docs-navlink.active { background: var(--accent-bg); color: var(--accent-2); font-weight: 700; }

.docs-main { min-width: 0; }
.docs-content { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; padding: 30px 36px 8px; }
.docs-content .prose { max-width: 760px; }
.docs-lede { font-size: 17px; color: var(--ink-2); margin: -2px 0 26px; line-height: 1.5; }
.prose h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; margin: 10px 0 14px; letter-spacing: -0.01em; }
.prose h2 { scroll-margin-top: calc(var(--docs-top) + 16px); }
.prose h3 { scroll-margin-top: calc(var(--docs-top) + 16px); }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent-2); }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
.prose th { font-weight: 700; color: var(--ink); }

.docs-onpage { position: sticky; top: calc(var(--docs-top) + 24px); align-self: start; font-size: 13px; }
.docs-onpage-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.docs-onpage a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--border); color: var(--ink-3); text-decoration: none; line-height: 1.4; }
.docs-onpage a:hover { color: var(--accent-2); border-left-color: var(--accent); }

.docs-prevnext { display: flex; justify-content: space-between; gap: 16px; margin: 40px 0 8px; padding-top: 22px; border-top: 1px solid var(--border); }
.docs-pn { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; max-width: 48%; }
.docs-pn.next { text-align: right; margin-left: auto; }
.docs-pn span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.docs-pn b { color: var(--ink); font-size: 14.5px; }
.docs-pn:hover { border-color: var(--accent); background: var(--accent-soft, var(--surface-2)); }

.docs-foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 24px 36px 40px; color: var(--ink-3); font-size: 13px; }
.docs-foot a { color: var(--ink-3); text-decoration: none; }
.docs-foot a:hover { color: var(--accent-2); }
.docs-foot-links { display: flex; gap: 16px; }

.docs-backdrop { display: none; }

@media (max-width: 1020px) {
  .docs-content { grid-template-columns: minmax(0, 1fr); }
  .docs-onpage { display: none; }
}
@media (max-width: 820px) {
  .docs-burger { display: grid; }
  .docs-toplink { display: none; }
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed; top: 0; left: 0; z-index: 60; width: 280px; max-width: 86vw;
    height: 100vh; background: var(--surface); border-right: 1px solid var(--border);
    padding-top: 22px; transform: translateX(-100%); transition: transform .22s ease;
  }
  .docs-shell.nav-open .docs-sidebar { transform: none; box-shadow: var(--shadow-lg, 0 24px 60px rgba(0,0,0,.3)); }
  .docs-shell.nav-open .docs-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }
  .docs-content { padding: 24px 20px 8px; }
  .docs-foot { padding: 24px 20px 40px; }
}
