/* LiquidCurve docs layout, on top of site.css */

.docs-body {
  display: flex;
  max-width: 1260px;
  margin: 0 auto;
  gap: 46px;
  padding: 108px 24px 70px;
}

/* sidebar */
.docs-side {
  width: 222px;
  flex: none;
  position: sticky;
  top: 96px;
  align-self: flex-start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.side-group { margin-bottom: 22px; }
.side-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
  padding: 0 12px 8px;
}
.side-link {
  display: block;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { color: var(--ink); background: rgba(17, 24, 39, 0.04); }
.side-link.active {
  color: var(--pink);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* article */
.docs-main { flex: 1; min-width: 0; max-width: 730px; }
.docs-h1 {
  font-size: clamp(32px, 3.6vw, 42px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.docs-lead {
  margin-top: 14px;
  font-size: 16.5px;
  color: #4b5563;
  max-width: 620px;
}
.docs-main article h3 {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  scroll-margin-top: 104px;
}
.docs-main article p { margin-top: 12px; font-size: 15px; color: #374151; }
.docs-main article p b { color: var(--ink); }
.docs-main article ul, .docs-main article ol { margin: 12px 0 0 22px; font-size: 15px; color: #374151; }
.docs-main article li { margin-top: 7px; }
.docs-main article li::marker { color: var(--faint); font-weight: 600; }
.docs-main article a { color: var(--blue); font-weight: 500; }
.docs-main article a:hover { text-decoration: underline; text-underline-offset: 3px; }
.docs-main code.inl {
  padding: 2px 7px;
  border-radius: 7px;
  background: #eceef0;
  font-size: 13px;
  color: #1f2937;
}

/* figures */
.fig {
  margin-top: 20px;
  border: 1px solid var(--edge-soft);
  border-radius: 18px;
  background: #fff;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.fig figcaption { margin-top: 14px; font-size: 12.5px; color: var(--faint); text-align: center; }
.fig canvas { width: 100%; height: 240px; display: block; }

/* terminal */
.term {
  margin-top: 20px;
  background: #1c0a13;
  border-radius: 16px;
  padding: 18px 20px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12.8px;
  line-height: 1.9;
  color: #c8cdd6;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}
.term .t-dim { color: #667085; }
.term .t-ok { color: #ff5ca8; }
.term .t-b { color: #fff; font-weight: 600; }

/* flow diagrams */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; }
.fnode {
  min-width: 240px;
  text-align: center;
  padding: 13px 20px;
  border-radius: 14px;
  background: #f7f8f9;
  border: 1px solid var(--edge-soft);
}
.fnode b { display: block; font-size: 14px; }
.fnode small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.fnode.hot { background: #ffeaf4; border-color: rgba(255, 0, 122, 0.25); }
.fnode.hot b { color: var(--blue); }
.farrow { color: var(--faint); font-size: 15px; line-height: 2; }
.fsplit { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.flow-h { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.flow-h .fnode { min-width: 0; flex: 1; }
.flow-h .farrow { align-self: center; }

/* mini curve grid */
.curve-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.mini {
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  padding: 14px 14px 10px;
  background: #fbfbfc;
}
.mini svg { width: 100%; height: auto; display: block; }
.mini .mname { margin-top: 8px; font-size: 12.5px; font-weight: 600; text-align: center; }

/* tables */
.doc-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  overflow: hidden;
}
.doc-table th {
  text-align: left;
  padding: 11px 16px;
  background: #f7f8f9;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--faint);
  border-bottom: 1px solid var(--edge-soft);
}
.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--edge-soft);
  color: #374151;
  vertical-align: top;
}
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* fee bar */
.fee-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; }
.fee-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.fee-legend .dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; margin-right: 5px; }

/* right toc */
.docs-toc {
  width: 196px;
  flex: none;
  position: sticky;
  top: 96px;
  align-self: flex-start;
}
.docs-toc-cap {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--faint);
  padding: 0 12px 8px;
}
.docs-toc a {
  display: block;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--edge-soft);
  transition: color 0.15s, border-color 0.15s;
}
.docs-toc a:hover { color: var(--ink); border-color: var(--faint); }

/* pager */
.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 52px;
}
.pglink {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 18px;
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  background: #fff;
  transition: box-shadow 0.18s, transform 0.18s;
}
.pglink:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pglink small { font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; color: var(--faint); }
.pglink b { font-size: 14.5px; }
.pglink.next { text-align: right; align-items: flex-end; grid-column: 2; }

/* mobile menu button + drawer */
.docs-menu-btn {
  display: none;
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff2e91, #f10074);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--shadow-lg);
}

@media (max-width: 1100px) {
  .docs-toc { display: none; }
}
@media (max-width: 880px) {
  .docs-side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 160;
    width: min(300px, 84vw);
    max-height: none;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg);
    padding: 96px 18px 30px;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  .docs-side.open { transform: none; }
  .docs-menu-btn { display: inline-flex; }
  .docs-pager { grid-template-columns: 1fr; }
  .pglink.next { grid-column: auto; }
}
