/* The documentation (crates/tally-web/src/docs), over tokens.css, app.css and guides.css
   (the masthead, the breadcrumbs and the colophon). The landing's manual look, made for
   reading and coming back to: the menu in a column on the left, numbered sections with
   mono labels and hairlines, the page's contents on the right, code on ink panels.
   The walkthrough's steps are marked with the tally itself, one stroke a step; the fifth,
   across, is the receipt at the end. Every class here is docs-…, so neither the app's nor
   the other pages' rules reach in (tally-web's stylesheets test checks). No inline style:
   tabs switch with radio buttons and :has(), and the script only adds conveniences. */

:root {
  --docs-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --docs-top: 60px;
  --docs-limit: #fff6e5;
  --docs-limit-line: #e9c97f;
  --docs-check: #ecf8f2;
  --docs-mat-a: #e2eeff;
  --docs-mat-b: #ece5ff;
  --docs-shadow: 0 1px 2px rgba(11, 13, 18, .05), 0 18px 40px -24px rgba(11, 13, 18, .26);
  --docs-rail: #d5d9e1;
}

:root[data-theme="dark"] {
  --docs-limit: #1f1907;
  --docs-limit-line: #6b5520;
  --docs-check: #0d2416;
  --docs-mat-a: #0e1828;
  --docs-mat-b: #191230;
  --docs-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 22px 44px -24px rgba(0, 0, 0, .8);
  --docs-rail: #333333;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --docs-limit: #1f1907;
    --docs-limit-line: #6b5520;
    --docs-check: #0d2416;
    --docs-mat-a: #0e1828;
    --docs-mat-b: #191230;
    --docs-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 22px 44px -24px rgba(0, 0, 0, .8);
    --docs-rail: #333333;
  }
}

/* ------------------------------------------------------------------ Layout */

/* Three columns: the menu, the article, the page's contents. */
.docs-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 760px) 196px;
  justify-content: space-between;
  column-gap: 48px;
  align-items: start;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 28px 0;
}

.docs-article {
  min-width: 0;
}

/* ------------------------------------------------------------------ The menu */

.docs-menu {
  position: sticky;
  top: calc(var(--docs-top) + 24px);
  max-height: calc(100vh - var(--docs-top) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

/* On wide screens the menu is always shown, open or not: the script opens it too, for
   browsers without ::details-content. */
@media (min-width: 961px) {
  .docs-menu::details-content {
    content-visibility: visible;
  }
}

.docs-menu-summary {
  display: none;
}

.docs-nav {
  display: grid;
  gap: 22px;
  padding-bottom: 24px;
}

.docs-nav-title {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .01em;
}

.docs-nav-n {
  color: var(--faint);
  font-family: var(--docs-mono);
  font-weight: 500;
}

.docs-nav-list {
  display: grid;
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--line);
}

.docs-nav-link {
  position: relative;
  display: block;
  margin-left: -1px;
  padding: 5px 10px 5px 14px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}

.docs-nav-link[data-child] {
  padding-left: 28px;
  font-size: 13.5px;
}

.docs-nav-link:hover {
  border-left-color: var(--faint);
  color: var(--ink);
}

/* The page you're on: a stroke of the tally beside it. */
.docs-nav-link[aria-current="page"] {
  border-left-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.docs-nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -1px;
  width: 2px;
  border-radius: 1px;
  background: var(--ink);
}

/* ------------------------------------------------------------------ The head */

.docs-head {
  padding-bottom: 8px;
}

.docs-kicker {
  margin-top: 26px;
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 12.5px;
}

.docs-title {
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -.03em;
  overflow-wrap: break-word;
}

.docs-lede {
  max-width: 62ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.58;
}

/* ------------------------------------------------------------------ Sections */

.docs-sections {
  margin-top: 36px;
}

.docs-section {
  scroll-margin-top: calc(var(--docs-top) + 24px);
  padding: 40px 0 44px;
  border-top: 1px solid var(--line);
}

.docs-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

.docs-number {
  flex: none;
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.docs-sub {
  margin-top: 30px;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.3;
}

.docs-p {
  max-width: 68ch;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.66;
}

.docs-article a:not([class]) {
  color: var(--ink);
  text-decoration-color: var(--faint);
  text-underline-offset: 2px;
}

.docs-article a:not([class]):hover {
  text-decoration-color: var(--ink);
}

.docs-article strong {
  color: var(--ink);
  font-weight: 650;
}

/* Code inside a sentence. */
.docs-ic {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--docs-mono);
  font-size: .86em;
  overflow-wrap: anywhere;
}

/* Lists with a dashed rule before each item, as on the landing. */
.docs-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  list-style: none;
  padding: 0;
}

.docs-list li {
  position: relative;
  max-width: 68ch;
  padding-left: 22px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.62;
}

.docs-list li::before {
  content: "";
  position: absolute;
  top: .86em;
  left: 2px;
  width: 10px;
  border-top: 1.5px dashed var(--faint);
}

/* Numbered steps: what to do, in order. */
.docs-steps {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}

.docs-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 14px;
}

.docs-step-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: var(--radius-bar);
  background: var(--button-bg);
  color: var(--button-ink);
  font-family: var(--docs-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.docs-step-body {
  min-width: 0;
}

.docs-step-title {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
}

.docs-step-body > .docs-p:first-of-type,
.docs-step-body > .docs-table-wrap:first-of-type {
  margin-top: 10px;
}

/* ------------------------------------------------------------- The walkthrough */

/* Each step is a stroke of the tally, on a rail that runs down the steps. */
.docs-walk-step {
  position: relative;
  padding-left: 64px;
}

.docs-walk-step::before {
  content: "";
  position: absolute;
  top: 92px;
  bottom: -40px;
  left: 21px;
  border-left: 1.5px dashed var(--docs-rail);
}

.docs-walk-step:last-child::before {
  bottom: 0;
}

.docs-walk-step .docs-heading {
  position: relative;
}

.docs-tally {
  position: absolute;
  top: -6px;
  left: -64px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.docs-tally svg {
  width: 28px;
  height: 24px;
}

.docs-stroke,
.docs-stroke-todo {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.docs-stroke-todo {
  stroke: var(--faint);
  opacity: .3;
}

/* Do, You'll see, Check it worked. */
.docs-part {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.docs-part:first-of-type {
  margin-top: 22px;
}

.docs-part-label {
  padding-top: 3px;
  color: var(--muted);
  font-family: var(--docs-mono);
  font-size: 12.5px;
}

.docs-part-body {
  min-width: 0;
}

.docs-part-body > :first-child {
  margin-top: 0;
}

.docs-done {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.01em;
}

.docs-done-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  background: var(--button-bg);
}

.docs-done-mark svg {
  width: 28px;
  height: 24px;
}

.docs-done-mark .docs-stroke {
  stroke: var(--button-ink);
}

.docs-cross {
  fill: none;
  stroke: var(--revenue);
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* ------------------------------------------------------------------ Code */

.docs-code,
.docs-tabs {
  max-width: 100%;
  margin-top: 16px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow: hidden;
}

.docs-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 4px 8px 4px 16px;
  border-bottom: 1px solid rgba(216, 238, 230, .1);
}

.docs-code-label {
  min-width: 0;
  overflow: hidden;
  color: rgba(230, 238, 250, .62);
  font-family: var(--docs-mono);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow-x: auto;
  color: var(--code-ink);
  font-family: var(--docs-mono);
  font-size: 13px;
  line-height: 1.62;
  tab-size: 2;
  scrollbar-width: thin;
}

/* Not the app's inline code chip. */
.docs-pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.docs-code-note {
  padding: 10px 16px 12px;
  border-top: 1px solid rgba(216, 238, 230, .1);
  color: rgba(230, 238, 250, .7);
  font-size: 13.5px;
  line-height: 1.5;
}

.docs-code-note .docs-ic {
  border-color: rgba(216, 238, 230, .16);
  background: rgba(216, 238, 230, .06);
  color: var(--code-ink);
}

.docs-copy {
  display: grid;
  flex: none;
  height: 28px;
  min-width: 68px;
  padding: 0 10px;
  border: 1px solid rgba(216, 238, 230, .24);
  border-radius: 6px;
  background: transparent;
  color: var(--code-ink);
  font: 500 12px var(--docs-mono);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}

.docs-copy[hidden] {
  display: none;
}

.docs-copy:hover {
  border-color: rgba(216, 238, 230, .6);
  background: rgba(216, 238, 230, .06);
}

.docs-copy:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.docs-copy-idle,
.docs-copy-done {
  grid-area: 1 / 1;
  align-self: center;
  transition: opacity .2s ease, transform .3s var(--ease-out);
}

.docs-copy-done {
  opacity: 0;
  transform: translateY(6px);
}

.docs-copy[data-copied] .docs-copy-idle {
  opacity: 0;
  transform: translateY(-6px);
}

.docs-copy[data-copied] .docs-copy-done {
  opacity: 1;
  transform: none;
}

/* Tabs: radio buttons in a row on the panel's own bar; the chosen one's panel shows. */
.docs-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0;
  padding: 6px 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(216, 238, 230, .1);
}

.docs-tab {
  position: relative;
  padding: 8px 10px 9px;
  color: rgba(230, 238, 250, .58);
  font-family: var(--docs-mono);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s ease;
}

.docs-tab:hover {
  color: var(--code-ink);
}

.docs-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.docs-tab:has(.docs-tab-input:checked) {
  color: var(--code-ink);
}

.docs-tab:has(.docs-tab-input:checked)::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--revenue);
}

.docs-tab:has(.docs-tab-input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 4px;
}

.docs-panels {
  display: grid;
}

.docs-panel {
  grid-area: 1 / 1;
  min-width: 0;
  visibility: hidden;
}

.docs-panel-bar {
  display: flex;
  justify-content: flex-end;
  height: 0;
}

.docs-panel-bar .docs-copy {
  position: relative;
  z-index: 1;
  margin: 8px 8px 0 0;
}

.docs-panel .docs-pre {
  padding-right: 96px;
}

.docs-tabs:has(.docs-tab-input[value="1"]:checked) .docs-panel[data-panel="1"],
.docs-tabs:has(.docs-tab-input[value="2"]:checked) .docs-panel[data-panel="2"],
.docs-tabs:has(.docs-tab-input[value="3"]:checked) .docs-panel[data-panel="3"],
.docs-tabs:has(.docs-tab-input[value="4"]:checked) .docs-panel[data-panel="4"],
.docs-tabs:has(.docs-tab-input[value="5"]:checked) .docs-panel[data-panel="5"],
.docs-tabs:has(.docs-tab-input[value="6"]:checked) .docs-panel[data-panel="6"],
.docs-tabs:has(.docs-tab-input[value="7"]:checked) .docs-panel[data-panel="7"],
.docs-tabs:has(.docs-tab-input[value="8"]:checked) .docs-panel[data-panel="8"] {
  visibility: visible;
}

/* ------------------------------------------------------------------ Callouts */

.docs-callout {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  max-width: 68ch;
  margin-top: 18px;
  padding: 14px 18px 16px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--faint);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--surface);
}

.docs-callout[data-tone="check"] {
  border-left-color: var(--live);
  background: var(--docs-check);
}

.docs-callout[data-tone="limit"] {
  border-color: var(--docs-limit-line);
  border-left-color: var(--docs-limit-line);
  background: var(--docs-limit);
}

.docs-callout-label {
  padding-top: 3px;
  color: var(--muted);
  font-family: var(--docs-mono);
  font-size: 12px;
}

.docs-callout-body {
  min-width: 0;
}

.docs-callout-body > :first-child,
.docs-callout-body > .docs-list:first-child {
  margin-top: 0;
}

.docs-callout .docs-p,
.docs-callout .docs-list li {
  font-size: 15px;
}

.docs-callout .docs-p + .docs-p {
  margin-top: 8px;
}

/* ------------------------------------------------------------------ Tables */

.docs-table-wrap {
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}

.docs-table th,
.docs-table td {
  padding: 11px 16px;
  border-top: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
}

.docs-table thead th {
  border-top: 0;
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 12px;
  font-weight: 500;
}

.docs-table tbody th {
  min-width: 9em;
  color: var(--ink);
  font-weight: 600;
}

.docs-table td {
  color: var(--ink-2);
}

/* ------------------------------------------------------------- Field reference */

.docs-fields {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.docs-field {
  padding: 14px 18px;
}

.docs-field + .docs-field {
  border-top: 1px solid var(--line-2);
}

.docs-field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.docs-field-name {
  margin-right: 4px;
  color: var(--ink);
  font-family: var(--docs-mono);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.docs-field-tag {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-bar);
  color: var(--muted);
  font-family: var(--docs-mono);
  font-size: 11.5px;
}

.docs-field-text {
  max-width: 68ch;
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ Cards */

.docs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}

.docs-card-link {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 16px 18px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, transform .3s var(--ease-out);
}

.docs-card-link:hover {
  border-color: var(--ink-2);
}

.docs-card-name {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 650;
}

.docs-card-name::after {
  content: "→";
  color: var(--faint);
  font-weight: 400;
  transition: color .2s ease, transform .3s var(--ease-out);
}

.docs-card-link:hover .docs-card-name::after {
  color: var(--ink);
  transform: translateX(3px);
}

.docs-card-line {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ Examples */

/* The product's screens in miniature, on a pastel mat, labelled. */
.docs-example {
  position: relative;
  max-width: 560px;
  margin-top: 16px;
  padding: 34px 22px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--docs-mat-a), var(--docs-mat-b));
}

.docs-example-tag {
  position: absolute;
  top: 10px;
  left: 14px;
  color: var(--muted);
  font-family: var(--docs-mono);
  font-size: 11.5px;
}

.docs-ex-live,
.docs-ex-receipt,
.docs-ex-coverage {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--docs-shadow);
}

.docs-ex-live {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 14px;
}

.docs-ex-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 5px var(--live-tint);
}

.docs-ex-title {
  color: var(--live-ink);
  font-size: 15.5px;
  font-weight: 650;
}

.docs-ex-line {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.docs-ex-quiet {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.docs-ex-amount {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -.02em;
}

.docs-ex-chain {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  list-style: none;
  padding: 0;
}

.docs-ex-step {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 12px;
}

.docs-ex-step + .docs-ex-step::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 5px;
  height: 14px;
  border-left: 1.5px solid var(--line);
}

.docs-ex-node {
  grid-row: span 2;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid var(--revenue);
  border-radius: 50%;
  background: var(--surface);
}

.docs-ex-step-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.docs-ex-step-line {
  color: var(--muted);
  font-size: 13px;
}

.docs-ex-method {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 13.5px;
}

.docs-ex-coverage {
  display: grid;
  gap: 10px;
}

.docs-ex-meter {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 3px;
  height: 12px;
}

.docs-ex-cell {
  border-radius: 2px;
  background: var(--revenue-bar);
}

.docs-ex-cell[data-on="yes"] {
  background: var(--revenue);
}

/* ------------------------------------------------------------------ Pager */

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.docs-pager-link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease;
}

.docs-pager-link:hover {
  border-color: var(--ink-2);
}

.docs-pager-link[data-rel="next"] {
  grid-column: 2;
  text-align: right;
}

.docs-pager-label {
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 12px;
}

.docs-pager-name {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

.docs-support {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ Contents */

.docs-toc {
  position: sticky;
  top: calc(var(--docs-top) + 24px);
  max-height: calc(100vh - var(--docs-top) - 48px);
  overflow-y: auto;
  padding-top: 6px;
}

.docs-toc-title {
  margin-bottom: 10px;
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 12px;
}

.docs-toc-list {
  display: grid;
  gap: 1px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc-link {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: color .2s ease;
}

.docs-toc-link:hover,
.docs-toc-link[aria-current] {
  color: var(--ink);
}

.docs-toc-n {
  flex: none;
  width: 1.7em;
  color: var(--faint);
  font-family: var(--docs-mono);
  font-size: 11.5px;
  padding-top: 1px;
}

.docs-toc-link[aria-current] .docs-toc-n {
  color: var(--revenue-ink);
}

/* ------------------------------------------------------------ Narrower screens */

@media (max-width: 1180px) {
  .docs-layout {
    grid-template-columns: 216px minmax(0, 1fr);
    column-gap: 40px;
  }

  .docs-toc {
    display: none;
  }
}

/* One column: the menu folds under a button above the article. */
@media (max-width: 960px) {
  :root {
    --docs-top: 104px;
  }

  .docs-layout {
    display: block;
    padding-top: 20px;
  }

  .docs-article {
    margin-top: 26px;
  }

  .docs-menu {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
  }

  .docs-menu-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
  }

  .docs-menu-summary::-webkit-details-marker {
    display: none;
  }

  .docs-menu-summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-panel);
  }

  .docs-menu-label {
    color: var(--faint);
    font-family: var(--docs-mono);
    font-size: 12px;
  }

  .docs-menu-current {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .docs-menu-chevron {
    flex: none;
    width: 12px;
    height: 8px;
    margin-left: auto;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .3s var(--ease-out);
  }

  .docs-menu[open] .docs-menu-chevron {
    transform: rotate(180deg);
  }

  .docs-nav {
    padding: 4px 16px 18px;
    border-top: 1px solid var(--line-2);
  }

  .docs-nav-group:first-child {
    padding-top: 14px;
  }
}

@media (max-width: 640px) {
  .docs-layout {
    padding: 16px 16px 0;
  }

  .docs-lede {
    font-size: 17px;
  }

  .docs-p,
  .docs-list li,
  .docs-step-title {
    font-size: 15.5px;
  }

  .docs-section {
    padding: 32px 0 36px;
  }

  .docs-walk-step {
    padding-left: 0;
  }

  .docs-walk-step::before {
    display: none;
  }

  .docs-walk-step .docs-heading {
    flex-direction: column;
    gap: 14px;
  }

  .docs-tally {
    position: static;
  }

  .docs-part,
  .docs-callout {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .docs-cards,
  .docs-pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-pager-link[data-rel="next"] {
    grid-column: auto;
  }

  .docs-example {
    padding: 32px 12px 12px;
  }

  .docs-pre {
    font-size: 12.5px;
  }

  .docs-table tbody th {
    min-width: 7em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-copy-idle,
  .docs-copy-done,
  .docs-card-name::after,
  .docs-menu-chevron {
    transition: none;
  }
}
