/* ===========================================================
   onpath.run — docs styles (reuses tokens from styles.css)
   3-column docs shell: sidebar · content · on-this-page
   =========================================================== */

body.docs {
  background: var(--bg);
}

.docs-wrap {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--surface);
  border-inline: 1px solid var(--line);
  min-height: 100vh;
}

/* ---------- top bar ---------- */
.docs-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.docs-bar .brand {
  font-size: 16px;
}
.docs-bar .brand .mark {
  width: 24px;
  height: 24px;
}
.docs-bar .seg {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  margin-left: 2px;
}
.docs-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 280px;
  height: 38px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--faint);
  font-size: 13.5px;
  cursor: text;
  transition:
    border-color 0.15s,
    background 0.15s;
  white-space: nowrap;
}
.docs-search svg,
.docs-search .kbd {
  flex: none;
}
.docs-search:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}
.docs-search svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}
.docs-search .kbd {
  margin-left: auto;
}
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}
.docs-bar .bar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.docs-bar .bar-links a {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 7px 10px;
  border-radius: 7px;
}
.docs-bar .bar-links a:hover {
  background: var(--panel);
}
.menu-btn {
  display: none;
}

/* ---------- shell ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 232px;
  align-items: start;
}

/* ---------- sidebar ---------- */
.docs-side {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 26px 18px 60px 22px;
}
.docs-side::-webkit-scrollbar {
  width: 8px;
}
.docs-side::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
}
.nav-grp {
  margin-bottom: 22px;
}
.nav-grp > .gh-t {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  padding: 0 10px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-grp > .gh-t .ic {
  width: 13px;
  height: 13px;
  color: var(--faint);
}
.nav-grp a {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 7px;
  line-height: 1.3;
  transition:
    background 0.12s,
    color 0.12s;
}
.nav-grp a:hover {
  background: var(--panel);
  color: var(--ink);
}
.nav-grp a.active {
  background: var(--blue-tint);
  color: var(--blue-ink);
  font-weight: 500;
}
.nav-grp a .tag {
  margin-left: auto;
}

/* ---------- content ---------- */
.docs-main {
  padding: 36px 56px 90px;
  min-width: 0;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  font-family: var(--mono);
  margin-bottom: 18px;
  white-space: nowrap;
}
.crumbs .sep {
  opacity: 0.6;
}
.crumbs b {
  color: var(--muted);
  font-weight: 500;
}

article.page {
  display: none;
  max-width: 760px;
}
article.page.active {
  display: block;
  animation: pagein 0.35s ease;
}
@keyframes pagein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.page .doc-title {
  font-size: 34px;
  letter-spacing: -0.03em;
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 14px;
  padding-top: 0;
}
.page .lede {
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 8px;
}
.page h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 44px 0 14px;
  padding-top: 16px;
  scroll-margin-top: 80px;
}
.page h2:first-of-type {
  border-top: 0;
}
.page h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 30px 0 10px;
  scroll-margin-top: 80px;
  letter-spacing: -0.01em;
}
.page p {
  font-size: 15px;
  line-height: 1.68;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.page a.link {
  color: var(--blue);
  border-bottom: 1px solid var(--blue-line);
  padding-bottom: 1px;
}
.page a.link:hover {
  border-color: var(--blue);
}
.page ul,
.page ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.page li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.page li::marker {
  color: var(--faint);
}
.page strong {
  color: var(--ink);
  font-weight: 600;
}
.page p code,
.page li code,
.page td code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--blue-ink);
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.hr {
  height: 1px;
  background: var(--line);
  margin: 36px 0;
  border: 0;
}
.anchor-h {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.anchor-h .hashlink {
  opacity: 0;
  color: var(--faint);
  font-weight: 400;
  transition: opacity 0.12s;
}
.anchor-h:hover .hashlink {
  opacity: 1;
}

/* code blocks */
.code {
  background: var(--term-bg);
  border: 1px solid #20262f;
  border-radius: 11px;
  margin: 0 0 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px 0 14px;
  background: var(--term-head);
  border-bottom: 1px solid var(--term-line);
}
.code-head .fname {
  font-family: var(--mono);
  font-size: 12px;
  color: #aeb6c2;
}
.code-head .lang {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--term-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.code-head .copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #2a313c;
  color: var(--term-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  transition: all 0.12s;
}
.code-head .copy:hover {
  color: #d6dce5;
  border-color: #3a424f;
}
.code-head .copy svg {
  width: 12px;
  height: 12px;
}
.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--term-text);
}
.code pre::-webkit-scrollbar {
  height: 8px;
}
.code pre::-webkit-scrollbar-thumb {
  background: #2a313c;
  border-radius: 8px;
}
.cm-prompt {
  color: var(--term-blue);
}
.cm-cmd {
  color: #eef2f8;
}
.cm-flag {
  color: var(--term-dim);
}
.cm-str {
  color: var(--term-green);
}
.cm-dim {
  color: var(--term-dim);
}
.cm-ok {
  color: var(--term-green);
}
.cm-warn {
  color: var(--term-amber);
}
.cm-err {
  color: var(--term-red);
}
.cm-key {
  color: var(--term-purple);
}
.cm-num {
  color: var(--term-amber);
}

/* install tabs */
.tabs {
  margin: 0 0 18px;
}
.tabs-head {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.tabs-head button {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 13px;
  margin-bottom: -1px;
  transition:
    color 0.12s,
    border-color 0.12s;
}
.tabs-head button:hover {
  color: var(--ink);
}
.tabs-head button.on {
  color: var(--blue-ink);
  border-bottom-color: var(--blue);
}
.tabs .pane {
  display: none;
  padding-top: 14px;
}
.tabs .pane.on {
  display: block;
}

/* callouts */
.callout {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 0 0 18px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.6;
}
.callout .ci {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.callout p {
  margin: 0;
  font-size: 14px;
}
.callout p + p {
  margin-top: 8px;
}
.callout strong {
  color: inherit;
}
.callout.note {
  background: var(--blue-tint);
  border-color: var(--blue-line);
  color: #234;
}
.callout.note .ci {
  color: var(--blue);
}
.callout.warn {
  background: var(--amber-tint);
  border-color: var(--amber-line);
  color: #5a4209;
}
.callout.warn .ci {
  color: var(--amber);
}
.callout.tip {
  background: var(--green-tint);
  border-color: var(--green-line);
  color: #1c3f2b;
}
.callout.tip .ci {
  color: var(--green);
}

/* tables */
.tbl-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
}
table.doc {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.doc th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 500;
  padding: 11px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.doc td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
  line-height: 1.5;
}
table.doc tr:last-child td {
  border-bottom: 0;
}
table.doc td:first-child {
  white-space: nowrap;
}

/* command reference card */
.cmd-ref {
  border: 1px solid var(--line);
  border-radius: 11px;
  margin: 0 0 16px;
  overflow: hidden;
}
.cmd-ref .cr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.cmd-ref .cr-head code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  white-space: nowrap;
}
.cmd-ref .cr-head .badge {
  margin-left: auto;
}
.cmd-ref .cr-body {
  padding: 13px 14px;
}
.cmd-ref .cr-body p {
  margin: 0 0 10px;
  font-size: 14px;
}
.cmd-ref .cr-body p:last-child {
  margin-bottom: 0;
}
.cmd-ref dl.flags {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: 13.5px;
}
.cmd-ref dl.flags dt {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue-ink);
  white-space: nowrap;
}
.cmd-ref dl.flags dd {
  margin: 0;
  color: var(--muted);
}

/* step list */
.steps-doc {
  margin: 18px 0;
  padding: 0;
  list-style: none;
}
.steps-doc > li {
  position: relative;
  padding: 0 0 22px 44px;
}
.steps-doc > li > .sd-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-ink);
}
.steps-doc > li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.steps-doc > li:last-child::after {
  display: none;
}
.steps-doc > li h3 {
  margin: 4px 0 8px;
}

/* card links / next steps */
.cardlinks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.cardlink {
  display: block;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.12s;
}
.cardlink:hover {
  border-color: var(--blue-line);
  background: var(--blue-tint);
  transform: translateY(-1px);
}
.cardlink .cl-k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cardlink .cl-t {
  font-size: 15px;
  font-weight: 560;
  color: var(--ink);
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cardlink .cl-d {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* pager */
.pager {
  display: flex;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.pager a:hover {
  border-color: var(--line-strong);
  background: var(--panel);
}
.pager a.next {
  text-align: right;
}
.pager .pg-k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.pager .pg-t {
  font-size: 14.5px;
  font-weight: 560;
  color: var(--ink);
  margin-top: 4px;
}

/* ---------- on this page ---------- */
.docs-toc {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 36px 22px 60px 8px;
}
.docs-toc .toc-t {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-bottom: 12px;
}
.docs-toc a {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
  transition:
    color 0.12s,
    border-color 0.12s;
}
.docs-toc a.sub {
  padding-left: 24px;
  font-size: 12px;
}
.docs-toc a:hover {
  color: var(--ink);
}
.docs-toc a.active {
  color: var(--blue-ink);
  border-left-color: var(--blue);
  font-weight: 500;
}
.docs-toc .edit {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.docs-toc .edit a {
  border: 0;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}
.docs-toc .edit svg {
  flex: none;
}
.docs-toc .edit a:hover {
  color: var(--blue);
}
.docs-toc .edit svg {
  width: 13px;
  height: 13px;
}

/* ---------- search palette ---------- */
.palette-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 22, 28, 0.32);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.palette-bg.open {
  display: flex;
}
.palette {
  width: min(560px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.palette-in {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.palette-in svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.palette-in input {
  flex: 1;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: transparent;
}
.palette-in input::placeholder {
  color: var(--faint);
}
.palette-list {
  max-height: 52vh;
  overflow-y: auto;
  padding: 8px;
}
.palette-list .pgrp {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  padding: 10px 10px 5px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.palette-item .pi-ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}
.palette-item .pi-t {
  font-size: 14px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-item .pi-c {
  font-size: 12px;
  color: var(--faint);
  margin-left: auto;
  font-family: var(--mono);
  flex: none;
}
.palette-item.sel,
.palette-item:hover {
  background: var(--blue-tint);
}
.palette-item.sel .pi-t {
  color: var(--blue-ink);
}
.palette-item.sel .pi-ic {
  color: var(--blue);
}
.palette-foot {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--faint);
}
.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.palette-empty {
  padding: 28px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
  .docs-main {
    padding: 36px 40px 90px;
  }
}
@media (max-width: 860px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }
  .docs-side {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 290px;
    z-index: 55;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    height: calc(100vh - 60px);
  }
  .docs-side.open {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-2);
    border-radius: 9px;
    background: var(--surface);
  }
  .menu-btn svg {
    width: 18px;
    height: 18px;
  }
  .docs-search {
    width: 38px;
    flex: none;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }
  .docs-search .kbd {
    display: none;
  }
  .docs-bar .bar-links {
    display: none;
  }
  .docs-main {
    padding: 28px 22px 80px;
  }
  .cardlinks {
    grid-template-columns: 1fr;
  }
  .scrim {
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(20, 22, 28, 0.3);
    z-index: 54;
    display: none;
  }
  .scrim.open {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  article.page.active {
    animation: none;
  }
}
