/* Qorlith docs: three columns (sidebar, article, on-this-page), readable measure, interactive reference */
.docs { display: grid; grid-template-columns: 236px minmax(0, 1fr) 200px; gap: 48px; padding-top: 28px; padding-bottom: 72px; flex: 1; }
.side { position: sticky; top: 84px; align-self: start; max-height: calc(100dvh - 100px); overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.side-top { position: relative; margin-bottom: 18px; }
.side-top input { width: 100%; background: var(--card); border: 1px solid var(--line2); color: var(--text); border-radius: 999px; padding: 9px 36px 9px 14px; font: 14px var(--sans); }
.side-top input:focus { outline: none; border-color: rgba(92, 242, 200, .6); }
.side-top kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.sg { margin-bottom: 20px; }
.sg h3 { font: 500 12.5px var(--sans); color: var(--dim); margin: 0 0 6px 10px; letter-spacing: 0; }
.sg ul { list-style: none; margin: 0; padding: 0; }
.sg a { display: block; color: var(--muted); padding: 6px 10px; border-radius: 10px; font-size: 14px; transition: color .15s ease, background-color .15s ease; }
.sg a:hover { color: var(--text); background: rgba(255, 255, 255, .04); text-decoration: none; }
.sg a[aria-current="page"] { color: var(--mint); background: var(--mint-soft); }
.side-toggle { display: none; }
.otp { position: sticky; top: 84px; align-self: start; font-size: 13px; }
.otp p { color: var(--dim); margin: 4px 0 8px; }
.otp ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.otp a { display: block; color: var(--muted); padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; }
.otp a:hover { color: var(--text); text-decoration: none; }
.otp a.on { color: var(--mint); border-left-color: var(--mint); }

.doc { min-width: 0; max-width: 780px; outline: none; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; line-height: 1.08; margin: 4px 0 14px; }
.doc h2 { font-size: 23px; letter-spacing: -.025em; margin: 44px 0 12px; scroll-margin-top: 84px; }
.doc h3 { font-size: 17px; margin: 26px 0 8px; scroll-margin-top: 84px; }
.doc h2 .anchor, .doc h3 .anchor { color: var(--dim); opacity: 0; font-weight: 400; text-decoration: none; transition: opacity .15s ease; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc p, .doc li { color: #c6cee2; font-size: 15.5px; line-height: 1.7; }
.doc .lead { font-size: 18px; color: var(--muted); line-height: 1.6; max-width: 62ch; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc :not(pre) > code { font-family: var(--mono); font-size: .86em; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); word-break: break-word; }
.doc .note { margin: 18px 0; font-size: 15px; line-height: 1.6; }
.doc .note code { font-size: .85em; }

/* code blocks */
.cb { margin: 16px 0; border: 1px solid var(--line); border-radius: 14px; background: #070b14; overflow: hidden; }
.cb-h { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }
.cb-copy { background: none; border: 1px solid transparent; color: var(--muted); font: 12.5px var(--sans); padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.cb-copy:hover { color: var(--text); border-color: var(--line2); }
.cb pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); color: #cdd6ea; tab-size: 2; }
.cb .kw { color: #8ee9ff; } .cb .s { color: #f4c38e; } .cb .c { color: var(--dim); font-style: italic; } .cb .n { color: #b8a6ff; } .cb .k { color: var(--mint); }
.ctabs { margin: 16px 0; }
.ctabs > .seg { margin-bottom: -6px; }
.ctabs .cb { margin-top: 12px; }

/* tables */
.doc table.plain { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14.5px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: table; }
.doc table.plain th, .doc table.plain td { white-space: normal; vertical-align: top; padding: 10px 14px; }
.doc table.plain td { color: #c6cee2; }
.doc table.kvt td:first-child { color: var(--muted); width: 38%; }
.doc table.api-t td:first-child { width: 46%; }
.doc table.api-t code { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* cards on overview */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 26px 0 8px; }
.dcard { display: grid; gap: 6px; padding: 18px; color: var(--text); transition: border-color .15s ease, background-color .15s ease; }
.dcard:hover { text-decoration: none; border-color: rgba(92, 242, 200, .45); background: var(--hover); }
.dcard b { font-weight: 500; font-size: 16px; }
.dcard span { color: var(--muted); font-size: 14px; }
.usecases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin: 10px 0; }
.usecases b { font-weight: 500; }
.usecases p { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); }
.steps-list li { margin: 10px 0; }

/* reference */
.keybar { padding: 16px 18px; margin: 18px 0 8px; display: grid; gap: 8px; }
.keybar label { font-size: 14px; color: var(--muted); }
.keybar input { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 12px; padding: 9px 12px; font: 13px var(--mono); }
.keybar p { margin: 0; }
.ep { margin: 16px 0; scroll-margin-top: 84px; overflow: hidden; }
.ep-h { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .015); }
.ep-path { font: 500 14px var(--mono); color: var(--text); background: none !important; border: 0 !important; padding: 0 !important; word-break: break-all; }
.mth { font: 600 11.5px/1 var(--mono); padding: 5px 8px; border-radius: 6px; letter-spacing: .02em; }
.m-get { color: var(--mint); background: var(--mint-soft); }
.m-post { color: var(--amber); background: rgba(255, 196, 107, .1); }
.m-rpc { color: var(--blue); background: rgba(122, 140, 255, .12); }
.ep-b { padding: 4px 18px 16px; }
.ep-b h3 { margin: 14px 0 4px; }
.ep-b > p { margin: 6px 0 10px; font-size: 15px; }
.doc table.params { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.doc table.params th, .doc table.params td { white-space: normal; vertical-align: top; padding: 8px 10px; }
.doc table.params td:first-child { white-space: nowrap; }
.req { font-size: 11.5px; color: var(--amber); }
.enum { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.doc details { background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 0; margin: 10px 0; }
.doc details > summary { cursor: pointer; padding: 10px 14px; font-size: 14px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; }
.doc details > summary::-webkit-details-marker { display: none; }
.doc details > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease-out); }
.doc details[open] > summary::before { transform: rotate(45deg); }
.doc details > summary:hover { color: var(--text); }
.doc details[open] > summary { border-bottom: 1px solid var(--line); }
.doc details > .cb, .doc details > form { margin: 12px 14px 14px; }
.doc details.try[open] > summary { color: var(--mint); }
.try-f { gap: 10px; }
.try-f label { font-size: 13px; }
.try-f input, .try-f textarea { padding: 8px 11px; font-size: 13px; }
.try-out .cb { margin: 4px 0 0; }
.try-out pre { max-height: 420px; }

.pager-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager-nav a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-weight: 500; }
.pager-nav a:hover { border-color: rgba(92, 242, 200, .45); text-decoration: none; }
.pager-nav a.nx { text-align: right; grid-column: 2; }
.pager-nav small { color: var(--dim); font-weight: 400; font-size: 12.5px; }

/* migrated protocol page */
.protocol section { padding: 4px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; scroll-margin-top: 84px; }
.protocol section:last-child { border-bottom: 0; }
.protocol h2 { margin-top: 12px; }
.protocol table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.protocol table td { white-space: normal; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.facts b { display: block; font: 500 19px var(--mono); letter-spacing: -.02em; color: var(--text); }
.facts span { font-size: 13px; color: var(--muted); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--mint); background: var(--card); border-radius: 12px; padding: 14px 18px; margin: 16px 0; color: #c6cee2; font-size: 15px; line-height: 1.65; }
.callout.warn { border-left-color: var(--amber); }
.eco { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.eco-i { padding: 18px; color: var(--text); display: block; margin: 0 !important; }
.eco-i h3 { margin: 10px 0 6px; font-size: 16px; }
.eco-i p { margin: 0; font-size: 14px; color: var(--muted); }
.timeline { border-left: 1px solid var(--line2); margin-left: 8px; padding-left: 22px; }
.tl { position: relative; padding: 4px 0 20px; }
.tl::before { content: ''; position: absolute; left: -29px; top: 8px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line2); }
.tl.done::before { background: var(--mint); border-color: var(--mint); }
.tl.now::before { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(92, 242, 200, .15); }
.tl h3 { margin: 8px 0 4px; }
.tl p { margin: 0; }
.protocol .eyebrow { font-size: 13px; color: var(--mint); }

@media (max-width: 1180px) { .docs { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; } .otp { display: none; } }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; }
  .side { display: none; position: static; max-height: none; }
  body.side-open .side { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
  .side-toggle { display: inline-flex; justify-self: start; }
  .cards, .usecases, .facts, .eco { grid-template-columns: 1fr; }
  .pager-nav { grid-template-columns: 1fr; } .pager-nav a.nx { grid-column: 1; }
  .doc table.plain td, .doc table.plain th { padding: 8px 10px; }
  .doc table.api-t td:first-child { width: auto; }
  .doc table.api-t, .doc table.api-t tbody, .doc table.api-t tr, .doc table.api-t td { display: block; }
  .doc table.api-t td:first-child { border-bottom: 0; padding-bottom: 0; }
  .doc table.api-t code { white-space: normal; }
}
