html:has(.docs-page) { scroll-behavior: smooth; scroll-padding-top: 84px; }

.docs { display: grid; grid-template-columns: 188px minmax(0, 1fr) 152px; gap: 40px; align-items: start; padding-top: 40px; padding-bottom: 100px; }

.docs-side { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; animation: docs-in 0.6s var(--ease) both; }
.docs-nav { position: relative; display: grid; gap: 1px; padding-left: 12px; border-left: 1px solid var(--line); }
.docs-nav-group { margin: 18px 0 6px; font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; }
.docs-nav-group:first-child { margin-top: 0; }
.docs-nav a {
  position: relative; display: block; padding: 6px 10px; margin-left: -10px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text-2); transition: color 0.2s, background 0.2s;
}
.docs-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.docs-nav a.is-active { color: var(--fg-strong); }
.docs-nav-ind {
  position: absolute; left: -1px; top: 0; width: 1px; height: 0; background: var(--sand);
  box-shadow: 0 0 10px rgba(216, 188, 146, 0.6); transition: transform 0.45s var(--ease), height 0.45s var(--ease), opacity 0.3s;
}

.docs-toc { position: sticky; top: 86px; animation: docs-in 0.6s 0.1s var(--ease) both; }
.docs-toc-title { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-bottom: 10px; }
#docs-toc { display: grid; gap: 2px; }
#docs-toc a { display: block; padding: 3px 0; font-size: 12.5px; color: var(--text-3); transition: color 0.2s, transform 0.25s var(--ease); }
#docs-toc a:hover { color: var(--text); }
#docs-toc a.is-active { color: var(--sand); transform: translateX(3px); }

.docs-toc-toggle { display: none; }

.docs-main { min-width: 0; max-width: 760px; }
.doc { padding-bottom: 64px; margin-bottom: 64px; border-bottom: 1px solid var(--line); }
.doc:last-of-type { border-bottom: 0; margin-bottom: 0; }
.doc { opacity: 0; transform: translateY(12px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.doc.in { opacity: 1; transform: none; }
.doc h1 { margin: 10px 0 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.035em; line-height: 1.1; font-weight: 600; color: var(--fg-strong); }
.doc h2 { margin: 36px 0 10px; font-size: 18px; letter-spacing: -0.02em; font-weight: 600; color: var(--fg-strong); }
.doc .lead { margin: 14px 0 22px; font-size: 17px; line-height: 1.6; color: var(--text-2); }
.doc p, .doc li { font-size: 14.5px; line-height: 1.75; color: var(--text-2); }
.doc p { margin: 0 0 14px; }
.doc b, .doc strong { color: var(--text); font-weight: 600; }
.doc i { color: var(--text); font-style: normal; }
.doc a:not(.btn) { color: var(--sand); text-decoration: underline; text-decoration-color: rgba(216, 188, 146, 0.3); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.doc a:not(.btn):hover { text-decoration-color: var(--sand); }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc ul li::marker { color: var(--text-3); }
.doc li { margin: 4px 0; }
.doc :not(pre) > code { font-size: 0.86em; padding: 2px 6px; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--line); color: #e9dcc6; }
.doc .code { margin: 8px 0 16px; }

.doc .md-table { overflow-x: auto; margin: 6px 0 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.doc table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.doc th, .doc td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--text-3); font-weight: 500; background: var(--bg-1); font-size: 12.5px; }
.doc td { color: var(--text-2); }
.doc td:first-child { color: var(--text); white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc tbody tr { transition: background 0.15s; }
.doc tbody tr:hover { background: rgba(255, 255, 255, 0.015); }

.doc-steps { list-style: none; counter-reset: s; margin: 0 0 18px; padding: 0; display: grid; gap: 2px; }
.doc-steps li { counter-increment: s; position: relative; margin: 0; padding: 10px 0 10px 44px; }
.doc-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font: 500 12px/1 var(--mono); color: var(--sand);
  background: var(--sand-dim); border: 1px solid rgba(216, 188, 146, 0.2);
}
.doc-steps li:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 40px; bottom: -8px; width: 1px; background: var(--line-2); }

.callout {
  display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(216, 188, 146, 0.06), transparent 70%), var(--bg-1); border: 1px solid rgba(216, 188, 146, 0.18);
  font-size: 13.5px; line-height: 1.65; color: var(--text-2);
}
.callout > [data-icon] { color: var(--sand); flex: none; margin-top: 2px; }
.callout > [data-icon] svg { width: 16px; height: 16px; }
.callout-warn { background: linear-gradient(90deg, rgba(232, 180, 90, 0.07), transparent 70%), var(--bg-1); border-color: rgba(232, 180, 90, 0.2); }
.callout-warn > [data-icon] { color: var(--amber); }

.flow { display: flex; align-items: center; margin: 26px 0 8px; padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--bg-1); }
.flow-node { flex: none; display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 110px; }
.flow-node b { font-size: 13.5px; font-weight: 600; color: var(--fg-strong); }
.flow-node > span:last-child { font-size: 12px; color: var(--text-3); }
.flow-ic {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
  color: var(--sand); background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 0 0 4px rgba(216, 188, 146, 0.03);
}
.flow-ic svg { width: 19px; height: 19px; }
.flow-link { position: relative; flex: 1; height: 1px; margin: 0 6px 34px; background: linear-gradient(90deg, var(--line-2), var(--line-3), var(--line-2)); overflow: visible; }
.flow-link i {
  position: absolute; top: -2px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--sand);
  box-shadow: 0 0 10px 2px rgba(216, 188, 146, 0.55); animation: flow-dot 2.4s var(--ease) infinite;
}
.flow-link:nth-of-type(4) i { animation-delay: 1.2s; }
@keyframes flow-dot { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }

.tabs { margin: 6px 0 14px; }
.tabs-head { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg-1); border: 1px solid var(--line); margin-bottom: 10px; }
.tabs-head button { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; line-height: 1.3; white-space: nowrap; color: var(--text-3); transition: color 0.2s, background 0.2s; }
.tabs-head button:hover { color: var(--text); }
.tabs-head button[aria-selected='true'] { background: var(--bg-3); color: var(--fg-strong); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; }
.tab-panel { animation: fade-in 0.3s ease; }
.tab-panel .code { margin-bottom: 8px; }
.tab-panel p { font-size: 12.5px; margin: 0; }

.code-demo { display: flex; align-items: center; gap: 18px; margin: 24px 0 8px; padding: 22px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: radial-gradient(400px 160px at 50% 0%, rgba(216, 188, 146, 0.05), transparent), var(--bg-1); }
.code-demo > div { flex: 1; min-width: 0; display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line-2); font-size: 12px; }
.code-demo-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.code-demo-head .brand-mark { width: 22px; height: 22px; border-radius: 6.5px; }
.code-demo-head .pill { margin-left: auto; }
.code-demo-code, .code-demo-input { font-size: 22px; letter-spacing: 0.14em; color: var(--fg-strong); text-align: center; padding: 10px 0; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); }
.code-demo-input { border-color: rgba(216, 188, 146, 0.45); box-shadow: 0 0 0 3px rgba(216, 188, 146, 0.08); }
.code-demo-bar { height: 3px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.code-demo-bar i { display: block; height: 100%; width: 96%; background: var(--sand); border-radius: 3px; animation: code-timer 10s linear infinite; }
@keyframes code-timer { to { width: 0; } }
.code-demo-btn { display: grid; place-items: center; height: 32px; border-radius: 7px; background: var(--fg-strong); color: #111; font-weight: 500; font-size: 13px; line-height: 1.3; }
.code-demo-arrow { color: var(--sand); flex: none; animation: nudge 1.6s ease-in-out infinite; }
.code-demo-arrow svg { width: 18px; height: 18px; }
@keyframes nudge { 50% { transform: translateX(4px); } }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 19px; padding: 0 6px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; line-height: 1; color: var(--text); background: rgba(255, 255, 255, 0.02); box-shadow: inset 0 0 0 1px var(--line-2); vertical-align: 1px; }
.pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.pill-amber i { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.pill-green i { background: var(--green); }
@keyframes pulse { 50% { opacity: 0.3; } }

.composer-demo { margin: 14px 0 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-1); }
.composer-demo-text { padding: 16px 16px 8px; font-size: 14px; color: var(--fg-strong); }
.composer-demo-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 8px 10px; flex-wrap: wrap; }
.cd-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.3; color: var(--text-2); }
.cd-chip svg { width: 13px; height: 13px; }
.cd-sand { color: var(--sand); }
.cd-green { color: var(--green); background: rgba(111, 207, 151, 0.08); border: 1px solid rgba(111, 207, 151, 0.2); }
.cd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.cd-send { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--fg-strong); color: #111; }
.cd-send svg { width: 15px; height: 15px; stroke-width: 2.2; }

.effort-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 16px; }
.effort-card {
  display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-1);
  transition: border-color 0.25s, transform 0.35s var(--ease), background 0.25s;
}
.effort-card:hover { border-color: rgba(216, 188, 146, 0.25); transform: translateY(-2px); background: var(--bg-2); }
.effort-card .effort-bars { margin-bottom: 6px; }
.effort-card b { font-size: 13.5px; }
.effort-card span:last-child { font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

.faq-list { display: grid; gap: 8px; margin-top: 22px; }
.faq-d { border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-1); transition: border-color 0.25s, background 0.25s; }
.faq-d + .faq-d { margin-top: 0; }
.doc > .faq-d { margin: 10px 0; }
.faq-d:hover { border-color: var(--line-2); }
.faq-d[open] { border-color: var(--line-2); background: var(--bg-2); }
.faq-d summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; font-size: 14px; font-weight: 500; color: var(--text);
}
.faq-d summary::-webkit-details-marker { display: none; }
.faq-d summary::after {
  content: ''; width: 8px; height: 8px; flex: none; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-2px) rotate(45deg); transition: transform 0.35s var(--ease);
}
.faq-d[open] summary::after { transform: translateY(2px) rotate(225deg); }
.faq-d > div { padding: 0 16px 6px; }
.faq-d[open] > div { animation: faq-open 0.4s var(--ease); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } }

.doc-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 36px; padding: 22px 24px;
  border-radius: var(--radius-lg); border: 1px solid rgba(216, 188, 146, 0.2);
  background: radial-gradient(400px 140px at 0% 0%, rgba(216, 188, 146, 0.08), transparent), var(--bg-1);
}
.doc-cta > div { display: grid; gap: 2px; }
.doc-cta b { font-size: 15px; color: var(--fg-strong); }
.doc-cta span { font-size: 13.5px; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.doc-pager a {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.doc-pager a:hover { border-color: var(--line-2); background: var(--bg-1); transform: translateY(-1px); }
.doc-pager a span { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.doc-pager a b { font-size: 14px; font-weight: 500; color: var(--text); }
.doc-pager a.next { text-align: right; grid-column: 2; }

@keyframes docs-in { from { opacity: 0; transform: translateY(8px); } }

.docs-search { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; margin: 0 0 18px; padding: 0 8px 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.025); transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; }
.docs-search:focus-within { border-color: rgba(216, 188, 146, 0.4); background: rgba(255, 255, 255, 0.04); box-shadow: 0 0 0 3px rgba(216, 188, 146, 0.08); }
.docs-search [data-icon] svg { width: 14px; height: 14px; color: var(--text-3); display: block; }
.docs-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13px; }
.docs-search input::placeholder { color: var(--text-3); }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search .kbd { font-size: 10px; }
.docs-search:focus-within .kbd { opacity: 0; }
.docs-results { display: grid; gap: 2px; margin: -10px 0 18px; padding: 6px; max-height: min(60vh, 420px); overflow-y: auto; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-1); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9); animation: fade-in 0.15s ease; }
.docs-results a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); }
.docs-results a[aria-selected="true"], .docs-results a:hover { background: rgba(255, 255, 255, 0.05); }
.docs-hit-sec { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.docs-results b { font-size: 13px; font-weight: 500; color: var(--fg-strong); }
.docs-hit-text { font-size: 12px; line-height: 1.45; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.docs-results mark { background: rgba(216, 188, 146, 0.2); color: var(--sand); border-radius: 3px; padding: 0 1px; }
.docs-results-empty { padding: 12px 10px; font-size: 12.5px; color: var(--text-3); }
.is-found { animation: docs-found 1.6s var(--ease); border-radius: 8px; }
@keyframes docs-found { 0%, 30% { background: rgba(216, 188, 146, 0.12); box-shadow: 0 0 0 6px rgba(216, 188, 146, 0.12); } }

@media (max-width: 1180px) {
  .docs { grid-template-columns: 210px minmax(0, 1fr); gap: 44px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  html:has(.docs-page) { scroll-padding-top: 128px; }
  .docs { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .docs-toc-toggle {
    position: sticky; top: 70px; z-index: 30; display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 14px;
    border-radius: var(--radius); border: 1px solid var(--line-2); background: rgba(15, 15, 17, 0.9); backdrop-filter: blur(12px);
    font-size: 13.5px; color: var(--text); margin-bottom: 12px;
  }
  .docs-toc-toggle svg { width: 15px; height: 15px; color: var(--text-3); }
  .docs-toc-toggle #docs-current { flex: 1; text-align: left; }
  .docs-toc-toggle [data-icon='chevronDown'] svg { transition: transform 0.3s var(--ease); }
  .docs-toc-toggle[aria-expanded='true'] [data-icon='chevronDown'] svg { transform: rotate(180deg); }
  .docs-side {
    position: fixed; top: 124px; left: 16px; right: 16px; z-index: 40; max-height: 60vh; padding: 14px 16px; border-radius: var(--radius-lg);
    background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none; transition: opacity 0.25s, transform 0.3s var(--ease); animation: none;
  }
  .docs-side.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .flow { padding: 18px 12px; }
  .flow-node { min-width: 0; }
  .flow-link { margin: 0 4px 34px; }
  .code-demo { flex-direction: column; }
  .code-demo-arrow { transform: rotate(90deg); animation: none; }
  .effort-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .flow { flex-direction: column; gap: 6px; }
  .flow-link { width: 1px; height: 26px; flex: none; margin: 0; }
  .flow-link i { display: none; }
  .effort-grid { grid-template-columns: 1fr; }
  .doc-pager { grid-template-columns: 1fr; }
  .doc-pager a.next { grid-column: 1; }
  .doc td:first-child { white-space: normal; }
}
