/* Docs page layout only: the sticky contents rail, the prose column, the
   comparison table and the question list. Everything visual (colours, cards,
   buttons, pills) comes from laptop.css; nothing here overrides it. */

.doc-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* ---- contents rail ------------------------------------------------------ */
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 4px;
}
.doc-toc h2 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px 10px;
}
.doc-toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
}
.doc-toc a:hover { background: var(--paper-2); color: var(--ink); }
.doc-toc a.on { color: var(--ink); font-weight: 500; border-left-color: var(--accent); background: var(--accent-soft); }

/* ---- prose -------------------------------------------------------------- */
.doc-main { min-width: 0; }
.doc-lede { font-size: 16.5px; color: var(--ink-2); max-width: 62ch; }
.doc-sec { padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--line-2); scroll-margin-top: calc(var(--header-h) + 20px); }
.doc-sec:first-of-type { border-top: 0; margin-top: 22px; padding-top: 0; }
.doc-sec h2 { margin-bottom: 12px; }
.doc-sec h3 { margin: 24px 0 8px; }
.doc-main p, .doc-main li { max-width: 68ch; }
.doc-main ul, .doc-main ol { margin: 0 0 16px; padding-left: 20px; color: var(--ink-2); }
.doc-main li { margin-bottom: 7px; }
.doc-main li::marker { color: var(--ink-3); }
.doc-main strong { color: var(--ink); font-weight: 600; }
.doc-main code {
  font-family: var(--mono); font-size: 12.5px; background: var(--paper-2);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; color: var(--ink);
  /* an address is 42 characters of monospace and appears inside a sentence, so
     it has to be allowed to break rather than push the page sideways */
  max-width: 100%; overflow-wrap: anywhere;
}
.doc-main a.link { color: var(--accent); }
.doc-main a.link:hover { text-decoration: underline; }

/* numbered steps that read as a sequence rather than a bullet list */
.steps { list-style: none; margin: 0 0 18px; padding: 0; counter-reset: step; }
.steps li {
  position: relative; padding-left: 40px; margin-bottom: 16px; max-width: 66ch; color: var(--ink-2);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 25px; height: 25px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 600;
}
.steps b { color: var(--ink); }

/* the supply bar */
.split { display: flex; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin: 4px 0 8px; }
.split i {
  display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 500;
  border-right: 1px solid var(--line-2); min-width: 0; padding: 0 6px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.split i:last-child { border-right: 0; }
.split .pool { flex: 80; background: var(--accent-soft); color: var(--accent); }
.split .res { flex: 20; background: var(--paper-2); color: var(--ink-2); }

/* two facing lists: what a creator holds, what nobody holds */
.doc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-pair ul { margin: 0; padding-left: 18px; }

/* comparison table. Narrow screens cannot fit both fee columns, so the wrapper
   scrolls. The two gradients are a scroll shadow: the pair pinned with
   background-attachment local slide away with the content and uncover the pair
   pinned to the box, so a shadow shows on exactly the side that has more table
   behind it, and neither shows once the table fits. */
.doc-scroll {
  overflow-x: auto; margin-bottom: 16px; border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background:
    linear-gradient(to right, var(--card) 60%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--card) 60%, rgba(255, 255, 255, 0)) right center / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(18, 21, 26, 0.09), rgba(18, 21, 26, 0)) left center / 14px 100% no-repeat scroll,
    linear-gradient(to left, rgba(18, 21, 26, 0.09), rgba(18, 21, 26, 0)) right center / 14px 100% no-repeat scroll,
    var(--card);
}
table.doc-tbl { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 13.5px; }
table.doc-tbl th, table.doc-tbl td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.doc-tbl tr:last-child th, table.doc-tbl tr:last-child td { border-bottom: 0; }
table.doc-tbl thead th { background: var(--paper); font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
table.doc-tbl tbody th { font-weight: 500; color: var(--ink-3); width: 27%; }
table.doc-tbl td { color: var(--ink-2); }

/* a window card used as a note inside the prose */
.doc-note { margin: 18px 0 20px; }
.doc-main .doc-note p { max-width: none; }
.doc-main p.last { margin-bottom: 0; }
.doc-after { margin-top: 16px; }
.quotes-note { margin-top: 12px; margin-bottom: 0; }

/* quote registry rows. A flex item will not shrink under its content unless it
   is told to, and an address is 42 characters of monospace, so every cell that
   holds one gets min-width: 0 and ellipsises instead of widening the page. */
.q-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.q-row:last-child { border-bottom: 0; }
.q-row .sym { font-weight: 600; min-width: 62px; flex: none; }
.q-row .addr { font-family: var(--mono); font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.q-row .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* questions */
.qa { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); overflow: hidden; }
.qa details { border-bottom: 1px solid var(--line-2); }
.qa details:last-child { border-bottom: 0; }
.qa summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { background: var(--paper); }
/* laptop.css rings a, button, input, select and textarea on :focus-visible. A
   details summary is keyboard focusable and is not in that list, so it would
   tab through with no ring at all. Inset, so the card's rounded edge keeps it. */
.qa summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 7px; }
.qa summary .mk { flex: none; color: var(--ink-3); transition: transform .18s ease; }
.qa details[open] summary .mk { transform: rotate(90deg); }
.qa details[open] summary { color: var(--ink); }
.qa .ans { padding: 0 14px 14px 38px; }
.qa .ans p { margin: 0 0 8px; font-size: 13.5px; }
.qa .ans p:last-child { margin-bottom: 0; }

/* an h3 can be a link target of its own (the snapshot rule), so it needs the
   same clearance under the fixed header that a section gets */
.doc-sec h3[id] { scroll-margin-top: calc(var(--header-h) + 20px); }

/* four short facts about the token, read as a block rather than a bullet list */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 20px; }
.fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 14px;
}
.fact h3 { margin: 0 0 6px; font-size: 14px; }
.doc-main .fact p { margin: 0; font-size: 13.5px; max-width: none; }

/* the two step snapshot: two cards with the waiting window named between them */
.flow { display: grid; gap: 0; margin: 18px 0 20px; }
.flow-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 14px;
}
.flow-n {
  flex: none; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.flow-step b { display: block; margin-bottom: 4px; }
.doc-main .flow-step p { margin: 0; font-size: 13.5px; max-width: none; }
/* the gap between the two steps carries the wait, drawn as a rule through it */
.flow-gap {
  position: relative; margin-left: 26px; padding: 9px 0 9px 24px;
  font-size: 12.5px; color: var(--ink-3);
}
.flow-gap::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(var(--line) 0 4px, transparent 4px 8px);
}

/* contract list */
.addr-list { display: grid; gap: 10px; }
.addr-item { display: grid; gap: 6px; min-width: 0; }
.addr-item .lbl { color: var(--ink-2); }
.addr-item .lbl small { display: block; color: var(--ink-3); font-size: 12px; }
.addr-item .ca { flex-wrap: wrap; row-gap: 8px; }
.addr-item .ca > span { min-width: 0; flex: 1 1 auto; }
.addr-item .ca .btn { flex: none; }

/* ---- 404 ---------------------------------------------------------------- */
.nf { max-width: 460px; margin: 8vh auto 0; }
.nf .win-body { padding: 26px 24px 24px; }
.nf h1 { font-size: 26px; margin-bottom: 8px; }
.nf p { margin-bottom: 18px; }
.nf .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.nf .keys { display: flex; gap: 5px; margin-bottom: 18px; }
.nf .keys i { height: 26px; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--line-2); flex: 1; }
.nf .keys i:nth-child(3) { flex: 3; }

@media (max-width: 1000px) {
  .doc-shell { grid-template-columns: 1fr; gap: 0; }
  .doc-toc { display: none; }
}
@media (max-width: 620px) {
  .doc-pair { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .doc-lede { font-size: 15.5px; }
  /* Narrow: the address gets its own line so it stays readable in full, and
     the two buttons sit under it rather than squeezing it to an ellipsis. */
  .addr-item .ca > span { flex: 1 1 100%; white-space: normal; word-break: break-all; }
  .addr-item .ca button { margin-left: 0; }
  .q-row { flex-wrap: wrap; row-gap: 6px; }
  .q-row .addr { flex: 1 1 100%; order: 3; }
}
