/* Ledgerline docs — three-column shell + runnable blocks */

.docs-topbar { border-bottom: 1px solid var(--hairline); background: #fff; position: sticky; top: 0; z-index: 60; }
.docs-topbar .nav-inner { height: 60px; }
.docs-topbar .brand { font-size: 19px; }
.docs-search { margin-left: 6px; flex: 1; max-width: 340px; }
.docs-search input { width: 100%; font-family: var(--sans); font-size: 14px; padding: 8px 14px; border: 1px solid var(--hairline); border-radius: 9px; background: var(--bg-tint); color: var(--slate); }
.docs-search input:focus { outline: 2px solid var(--blurple); outline-offset: 1px; background: #fff; }

.docslayout { display: grid; grid-template-columns: 250px minmax(0, 1fr); max-width: 1340px; margin: 0 auto; gap: 0; }

/* left nav */
.docs-side { border-right: 1px solid var(--hairline); padding: 32px 22px 60px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.docs-side h6 { font-size: 12px; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--slate-300); margin: 22px 0 9px; font-weight: 600; }
.docs-side h6:first-child { margin-top: 0; }
.docs-side a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--slate-400); font-size: 14.5px; font-weight: 500; transition: background .13s, color .13s; }
.docs-side a:hover { background: var(--bg-tint); color: var(--navy); }
.docs-side a.active { background: var(--blurple-050); color: var(--blurple-600); font-weight: 600; }

/* content */
.docs-content { padding: 40px clamp(24px, 4vw, 64px) 100px; min-width: 0; }
.docs-content .breadcrumb { font-family: var(--mono); font-size: 12.5px; color: var(--slate-300); margin-bottom: 12px; letter-spacing: .02em; }
.docs-content h1 { font-size: clamp(2rem, 3.5vw, 2.7rem); margin-bottom: 14px; }
.docs-content h2 { font-size: 1.5rem; margin: 46px 0 14px; scroll-margin-top: 80px; }
.docs-content h3 { font-size: 1.16rem; margin: 30px 0 10px; }
.docs-content p { margin-bottom: 15px; max-width: 68ch; }
.docs-content ul, .docs-content ol { margin: 0 0 16px; padding-left: 22px; max-width: 66ch; }
.docs-content li { margin-bottom: 7px; }
.docs-content .intro { font-size: 1.14rem; color: var(--slate); max-width: 62ch; }
.docs-content code:not([class]) { font-family: var(--mono); font-size: .88em; background: var(--bg-tint-2); color: var(--blurple-700); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--hairline); }
.docs-content a.inline { text-decoration: underline; text-underline-offset: 2px; }

.key-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg-tint); border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 18px; margin: 8px 0 30px; }
.key-banner .kb-label { font-size: 14px; color: var(--slate-400); }
.key-badge { font-family: var(--mono); font-size: 13.5px; color: var(--navy); background: #fff; border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 12px; user-select: all; }

/* endpoint = prose + runnable code (the three-column reading) */
.endpoint { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, 460px); gap: 34px; align-items: start; margin: 34px 0 12px; padding-top: 30px; border-top: 1px solid var(--hairline-2); }
.endpoint:first-of-type { border-top: 0; padding-top: 0; }
.endpoint > * { min-width: 0; }
.endpoint-doc { min-width: 0; }
.run { max-width: 100%; }
.endpoint-doc .verb { font-family: var(--mono); font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.endpoint-doc .verb .m { font-weight: 700; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; letter-spacing: .04em; }
.endpoint-doc .verb .m.post { background: rgba(21,190,83,.14); color: #0e9f43; }
.endpoint-doc .verb .m.get { background: var(--blurple-050); color: var(--blurple-600); }
.endpoint-doc .verb .path { color: var(--navy); }
.param-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 14px; }
.param-table td { padding: 9px 0; border-bottom: 1px solid var(--hairline-2); vertical-align: top; }
.param-table td:first-child { width: 150px; }
.param-table .pn { font-family: var(--mono); font-size: 13px; color: var(--navy); }
.param-table .pt { font-family: var(--mono); font-size: 11.5px; color: var(--slate-300); display: block; margin-top: 2px; }
.param-table .pd { color: var(--slate); }

/* runnable code pane */
.run { position: sticky; top: 78px; background: var(--code-bg); border-radius: 13px; box-shadow: var(--shadow-lg); overflow: hidden; }
.run-head { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.run-tabs { display: flex; gap: 2px; }
.run-tabs .rt { font-family: var(--mono); font-size: 12.5px; color: var(--code-mute); padding: 4px 10px; border-radius: 7px; cursor: pointer; transition: .13s; }
.run-tabs .rt:hover { color: #cdd8e8; }
.run-tabs .rt.active { color: #fff; background: rgba(255,255,255,.09); }
.run-actions { margin-left: auto; display: flex; gap: 6px; }
.run-copy { font-family: var(--mono); font-size: 12px; color: var(--code-mute); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; padding: 5px 10px; cursor: pointer; transition: .14s; }
.run-copy:hover { color: #fff; background: rgba(255,255,255,.12); }
.run-btn { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: #fff; background: var(--blurple); border: 0; border-radius: 7px; padding: 5px 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: .15s; }
.run-btn::before { content: '▶'; font-size: 9px; }
.run-btn:hover { background: var(--blurple-600); box-shadow: 0 3px 10px rgba(99,91,255,.5); }
.run-btn:disabled { opacity: .6; cursor: default; }
.run-btn.loading::before { content: ''; width: 11px; height: 11px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-code { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 12.8px; line-height: 1.7; color: var(--code-ink); white-space: pre; }
.run-code .tok-key { color: var(--code-key); } .run-code .tok-str { color: var(--code-str); } .run-code .tok-num { color: var(--code-num); } .run-code .tok-punc { color: var(--code-punc); } .run-code .tok-cmt { color: var(--code-mute); font-style: italic; } .run-code .tok-flag { color: #c9a2ff; }

.run-resp { display: none; border-top: 1px solid rgba(255,255,255,.1); background: #06121f; }
.rr-head { padding: 10px 16px; font-family: var(--mono); font-size: 12px; color: #8fa3c4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,.06); }
.rr-head.ok { color: #7dd3a8; } .rr-head.err { color: #ff8fa3; }
.rr-head .rr-dash, .rr-head .rr-open { color: var(--cyan); text-decoration: none; }
.rr-head .rr-dash:hover, .rr-head .rr-open:hover { text-decoration: underline; }
.rr-head .rr-open { margin-left: auto; color: #b7b1ff; }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.rr-json { margin: 0; padding: 14px 18px; max-height: 340px; overflow: auto; font-family: var(--mono); font-size: 12.4px; line-height: 1.65; color: var(--code-ink); white-space: pre; }
.rr-json .tok-key { color: #8ab4ff; } .rr-json .tok-str { color: #7dd3a8; } .rr-json .tok-num { color: #f5a97f; } .rr-json .tok-punc { color: #9db3d6; }

/* callouts */
.callout { display: flex; gap: 12px; padding: 15px 18px; border-radius: 11px; margin: 20px 0; font-size: 14.5px; border: 1px solid; max-width: 68ch; }
.callout .ci { flex: none; font-size: 17px; line-height: 1.4; }
.callout.tip { background: var(--blurple-050); border-color: #ddd9ff; color: var(--navy); }
.callout.warn { background: #fff8ec; border-color: #ffe2ad; color: #7a5a12; }
.callout p { margin: 0; max-width: none; }

.next-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.next-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 18px 20px; transition: .18s; display: block; }
.next-card:hover { border-color: var(--blurple); box-shadow: var(--shadow); transform: translateY(-2px); }
.next-card .nc-t { font-weight: 650; color: var(--navy); margin-bottom: 3px; }
.next-card .nc-d { font-size: 13.5px; color: var(--slate-400); }

.docs-mobnav { display: none; }
@media (max-width: 940px) {
  .endpoint { grid-template-columns: 1fr; gap: 18px; }
  .run { position: static; }
}
@media (max-width: 820px) {
  .docslayout { grid-template-columns: 1fr; }
  .docs-side { display: none; }
  .docs-mobnav { display: block; padding: 14px 20px; border-bottom: 1px solid var(--hairline); }
  .docs-mobnav select { width: 100%; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 9px; font-family: var(--sans); font-size: 15px; background: #fff; color: var(--navy); }
  .next-cards { grid-template-columns: 1fr; }
  .docs-search { display: none; }
}
