/* Finature MCP docs. Layout modeled on a developer docs site: top bar, left
   sidebar, centered article, right "On this page" rail. Tokens come from base.css. */

.docs-top {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.docs-top-inner {
  height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.docs-top .brand { font-size: 20px; flex: none; }
.docs-md-status { min-height: 1.4em; margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.docs-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 3px 7px; line-height: 1.2;
}
.docs-top-links { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.docs-top-links a { color: var(--ink-2); transition: color .15s; }
.docs-top-links a:hover { color: var(--ink); }
.docs-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.docs-search {
  position: relative; display: flex; align-items: center;
  width: 240px; height: 36px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
}
.docs-search:focus-within { border-color: var(--ink); }
.docs-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  padding: 0 10px 0 12px; font-size: 14px; color: var(--ink);
}
.docs-search input::placeholder { color: var(--muted); }
.docs-search kbd {
  margin-right: 8px; font-size: 11px; line-height: 1.4; color: var(--muted);
  background: transparent; padding: 1px 5px; border-radius: 4px;
}

.docs-icon-btn {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink);
  transition: border-color .15s;
}
.docs-icon-btn:hover { border-color: var(--ink); }
.docs-icon-btn .i-moon { display: none; }
:root[data-theme="light"] .docs-icon-btn .i-sun { display: none; }
:root[data-theme="light"] .docs-icon-btn .i-moon { display: block; }
:root[data-theme="dark"] .docs-icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .docs-icon-btn .i-moon { display: none; }

.docs-menu-btn { display: none; }

.docs-cta { height: 36px; font-size: 14px; padding: 0 14px; }

/* Layout grid */
.docs-wrap {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 260px minmax(0, 760px) 220px;
  column-gap: 56px;
  align-items: start;
}

/* Sidebar */
.docs-side {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 0 56px;
}
.docs-filter {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  margin-bottom: 20px;
}
.docs-filter:focus-within { border-color: var(--ink); }
.docs-filter svg { flex: none; color: var(--muted); }
.docs-filter input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 14px; color: var(--ink);
}
.docs-filter input::placeholder { color: var(--muted); }

.docs-nav-group { margin-bottom: 4px; }
.docs-nav-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 8px; border: 0; background: transparent; text-align: left;
  color: var(--ink);
}
.docs-nav-head .label { color: var(--ink); }
.docs-nav-head svg { transition: transform .2s var(--ease); color: var(--muted); }
.docs-nav-group.is-collapsed .docs-nav-head svg { transform: rotate(-90deg); }
.docs-nav-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.docs-nav-group.is-collapsed .docs-nav-list { display: none; }
.docs-nav-list a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: 15px; color: var(--ink-2); line-height: 1.35;
  transition: color .15s, background-color .15s;
}
.docs-nav-list a:hover { color: var(--ink); }
.docs-nav-list a[aria-current="true"] { background: var(--paper-2); color: var(--ink); }
.docs-nav-list li[hidden], .docs-nav-group[hidden] { display: none; }
.docs-side.is-filtering .docs-nav-group.is-collapsed .docs-nav-list { display: flex; }
.docs-side-head { align-items: center; justify-content: space-between; }
.docs-side-close { width: 40px; height: 40px; }
.docs-side-cta { display: none; margin-top: 16px; height: 40px; }
.docs-nav-empty { padding: 8px 10px; font-size: 14px; color: var(--muted); }
.docs-nav-empty[hidden] { display: none; }

/* Article */
.docs-main { min-width: 0; padding: 40px 0 96px; }
.docs-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; color: var(--muted);
  margin-bottom: 28px;
}
.docs-crumbs a { color: var(--muted); }
.docs-crumbs a:hover { color: var(--ink); }
.docs-crumbs span[aria-hidden] { color: var(--faint); }

.docs-main h1 {
  font-size: 52px; font-weight: 500; line-height: 1.04; letter-spacing: -0.035em;
  color: var(--ink); margin-bottom: 22px;
}
.docs-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  font-size: 14px; color: var(--muted); padding-bottom: 28px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.docs-meta .sep { color: var(--faint); }
.docs-meta button {
  border: 0; background: transparent; padding: 0; color: var(--ink-2);
  font-size: 14px; text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.docs-meta button:hover { color: var(--ink); }
.docs-meta button.is-copied { color: var(--accent); }
.docs-meta a { color: var(--ink-2); }
.docs-meta a:hover { color: var(--ink); }

.docs-article { color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.docs-article > * + * { margin-top: 0; }
.docs-article section { padding-top: 8px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.docs-article section + section { margin-top: 72px; border-top: 1px solid var(--line); padding-top: 40px; }
.docs-article h2 {
  font-size: 30px; font-weight: 500; line-height: 1.15; letter-spacing: -0.025em;
  color: var(--ink); margin: 0 0 18px; scroll-margin-top: calc(var(--nav-h) + 24px);
}
.docs-article h3 {
  font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em;
  color: var(--ink); margin: 40px 0 12px; scroll-margin-top: calc(var(--nav-h) + 24px);
}
.docs-article p { margin: 0 0 16px; }
.docs-article ul, .docs-article ol { margin: 0 0 18px; padding-left: 22px; }
.docs-article li { margin: 0 0 6px; }
.docs-article li::marker { color: var(--faint); }
.docs-article strong { color: var(--ink); font-weight: 500; }
.docs-article a {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.docs-article a:hover { text-decoration-color: var(--ink); }
:root[data-theme="light"] .docs-article a { text-decoration-color: var(--accent); }
.docs-article code {
  font-family: var(--mono); font-size: .86em;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px;
  padding: .08em .36em; color: var(--ink);
}
.docs-article .code code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.docs-article .code { margin: 18px 0 24px; }
.docs-article .code pre { font-size: 13.5px; line-height: 1.65; }

.docs-article .lead-note { font-size: 19px; line-height: 1.55; color: var(--ink); margin-bottom: 24px; }

/* Callouts: left rule only, no fill, no icon */
.docs-callout {
  margin: 24px 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}
.docs-callout.is-warning { border-left-color: #f2b880; }
.docs-callout p:last-child { margin-bottom: 0; }
.docs-callout strong { color: var(--ink); }

/* Tables: hairline rows, scroll inside a wrapper on small screens */
.docs-table-wrap { overflow-x: auto; margin: 18px 0 26px; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.docs-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.docs-table th, .docs-table td {
  text-align: left; vertical-align: top;
  padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line);
}
.docs-table th {
  font-family: var(--mono); font-size: 11.5px; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding-top: 10px; padding-bottom: 10px;
}
.docs-table td:first-child { color: var(--ink); white-space: nowrap; }
.docs-table td code, .docs-table th code { font-size: 13px; }
.docs-table td.mono, .docs-table td .mono { font-family: var(--mono); font-size: 13px; }
.docs-table td:last-child, .docs-table th:last-child { padding-right: 0; }

/* On this page rail */
.docs-rail {
  position: sticky; top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto; padding: 40px 0 56px;
}
.docs-rail-title { margin-bottom: 14px; }
.docs-rail ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.docs-rail li { margin: 0; }
.docs-rail a {
  display: block; margin-left: -1px; padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.35; color: var(--muted);
  transition: color .15s, border-color .15s;
}
.docs-rail a:hover { color: var(--ink); }
.docs-rail a.is-current { color: var(--ink); border-left-color: var(--ink); }

/* Footer */
.docs-foot { border-top: 1px solid var(--line); }
.docs-foot-inner {
  max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: space-between;
  font-size: 14px; color: var(--muted);
}
.docs-foot-links { display: flex; gap: 22px; }
.docs-foot-links a { color: var(--ink-2); }
.docs-foot-links a:hover { color: var(--ink); }

/* Mobile drawer and scrim */
.docs-scrim { display: none; }

/* Responsive */
@media (max-width: 1200px) {
  .docs-wrap { grid-template-columns: 240px minmax(0, 1fr); column-gap: 40px; }
  .docs-rail { display: none; }
  .docs-top-inner { gap: 20px; }
  .docs-tag { display: none; }
  .docs-top-links { gap: 14px; font-size: 14px; }
  .docs-search { width: 170px; }
}

@media (max-width: 960px) {
  .docs-top-links, .docs-search { display: none; }
  .docs-menu-btn { display: inline-flex; }
  .docs-top-right .docs-cta { display: none; }
  .docs-wrap { grid-template-columns: minmax(0, 1fr); }
  .docs-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: min(320px, 86vw); height: 100vh; max-height: none;
    background: var(--paper); border-right: 1px solid var(--line);
    padding: 20px var(--gutter) 40px;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .4s var(--ease), visibility .4s;
  }
  .docs-side.is-open { transform: none; visibility: visible; }
  .docs-side-head { display: flex; margin-bottom: 16px; }
  .docs-side-cta { display: inline-flex; }
  .docs-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .docs-scrim.is-open { opacity: 1; pointer-events: auto; }
  .docs-main { padding-top: 28px; }
  .docs-main h1 { font-size: 40px; }
}
@media (min-width: 961px) {
  .docs-side-head { display: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .docs-top-inner { gap: 12px; }
  .docs-main h1 { font-size: 36px; letter-spacing: -0.03em; }
  .docs-article { font-size: 16px; }
  .docs-article h2 { font-size: 26px; }
  .docs-article section + section { margin-top: 56px; }
  .docs-table { font-size: 14px; }
  .docs-table th, .docs-table td { padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-side, .docs-scrim, .docs-nav-head svg { transition: none; }
}

/* Meta row on phones: drop the separators and let items wrap cleanly. */
@media (max-width: 640px) {
  .docs-meta { column-gap: 18px; }
  .docs-meta .sep { display: none; }
}
