/* The advertising docs (/advertise): a sidebar of sections, a readable
   column, and "On this page" on the right. Colours come from /site.css. */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.docs {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .docs {
    padding: 0 24px;
  }
}
@media (min-width: 1024px) {
  .docs {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 40px;
  }
}
@media (min-width: 1280px) {
  .docs {
    grid-template-columns: 256px minmax(0, 1fr) 216px;
    gap: 48px;
  }
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.docs-side {
  display: none;
}
@media (min-width: 1024px) {
  .docs-side {
    display: block;
  }
}
.side-inner {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 4px 32px 0;
}
.side-nav ul {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}
.side-group {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.side-nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.35;
  text-decoration: none;
}
.side-nav a:hover {
  color: var(--ink);
  background: var(--fill);
}
.side-nav a[aria-current='page'] {
  color: var(--on-mint);
  background: var(--mint);
  font-weight: 600;
}
.side-cta {
  margin-top: 8px;
  padding: 16px;
  border-radius: 16px;
  background: var(--canvas);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.side-cta p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.side-cta .btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  white-space: normal;
  text-align: center;
}

/* ── Search (shown only with JavaScript) ─────────────────────────── */
.search {
  position: relative;
  margin-bottom: 20px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-3);
  cursor: text;
}
.search-field:focus-within {
  box-shadow: inset 0 0 0 2px var(--mint);
}
.search-field svg {
  flex: none;
}
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 400 0.93rem/1 var(--sans);
}
.search-field input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}
.search-field input::-webkit-search-cancel-button {
  filter: invert(1);
}
.search-field kbd {
  flex: none;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line);
  font: 500 0.75rem/1.4 var(--sans);
  color: var(--ink-3);
}
.search-results {
  margin-top: 10px;
}
.search-results p {
  margin: 4px 12px 10px;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-results a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
}
.search-results a:hover,
.search-results a:focus-visible {
  background: var(--fill);
}
.search-results b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}
.search-results small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.search-results span {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.search-results mark {
  background: transparent;
  color: var(--green-ink);
  font-weight: 600;
}
.searching .side-nav {
  display: none;
}

/* ── The menu on phones and tablets ─────────────────────────────── */
.docs-bar {
  position: sticky;
  top: 68px;
  z-index: 40;
  max-width: 1400px;
  margin: 12px auto 0;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .docs-bar {
    padding: 0 24px;
  }
}
@media (min-width: 1024px) {
  .docs-bar {
    display: none;
  }
}
.docs-menu {
  border-radius: 16px;
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line-soft), 0 12px 30px -18px rgba(0, 20, 10, 0.7);
}
.docs-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.92rem;
}
.docs-menu > summary::-webkit-details-marker {
  display: none;
}
.docs-menu-title {
  font-weight: 650;
  white-space: nowrap;
}
.docs-menu-here {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
}
.docs-menu-here::before {
  content: '›';
  margin-right: 8px;
}
.docs-menu-panel {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 4px 10px 12px;
  border-top: 1px solid var(--line-soft);
}
.docs-menu-panel .search {
  margin: 10px 0 14px;
}

/* ── The page ────────────────────────────────────────────────────── */
.docs-main {
  min-width: 0;
}
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 0 24px;
}
@media (min-width: 1024px) {
  .doc {
    padding-top: 40px;
  }
}
.crumbs ol {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.88rem;
  color: var(--ink-3);
}
.crumbs li + li::before {
  content: '›';
  margin-right: 8px;
}
.crumbs a {
  color: var(--ink-3);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.doc h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.6rem);
  line-height: 1.08;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  text-wrap: balance;
}
.doc-lede {
  margin: 14px 0 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.doc-body {
  margin-top: 28px;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.7;
}
.doc-body h2,
.doc-body h3 {
  color: var(--ink);
  scroll-margin-top: 140px;
  text-wrap: balance;
}
@media (min-width: 1024px) {
  .doc-body h2,
  .doc-body h3 {
    scroll-margin-top: 92px;
  }
}
.doc-body h2 {
  margin: 44px 0 10px;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.doc-body h3 {
  margin: 30px 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc-body p {
  margin: 0 0 16px;
}
.doc-body ul,
.doc-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.doc-body li {
  margin: 6px 0;
}
.doc-body li::marker {
  color: var(--green);
}
.doc-body b,
.doc-body strong {
  color: var(--ink);
  font-weight: 600;
}
.doc-body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--mint);
  font: 500 0.86em/1.4 var(--mono);
  overflow-wrap: anywhere;
}
.doc-body ul.cols {
  columns: 2 200px;
  column-gap: 24px;
}
.doc-body ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.doc-body ol.steps li {
  position: relative;
  padding-left: 40px;
  margin: 12px 0;
  counter-increment: step;
}
.doc-body ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-mint);
  font: 700 0.8rem/1 var(--sans);
}

/* The overview's price and cards. */
.price-hero {
  margin: 0 0 24px;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.price-hero p {
  margin: 0;
}
.price-hero span {
  color: var(--ink-2);
}
.price-hero b {
  font-size: clamp(2.2rem, 7vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.price-hero .price-sub {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin: 24px 0 8px;
}
.doc-cards a {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--canvas);
  box-shadow: 0 0 0 1px var(--line-soft);
  text-decoration: none;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.doc-cards a:hover {
  background: var(--fill);
  box-shadow: 0 0 0 1px var(--line);
}
.doc-cards b {
  display: block;
  color: var(--ink);
}
.doc-cards span {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.formula {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.5;
}

/* ── Callouts ────────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}
.callout > svg {
  flex: none;
  margin-top: 3px;
  color: var(--mint);
}
.callout > div > :last-child {
  margin-bottom: 0;
}
.callout p {
  color: var(--ink);
}
.callout.tip {
  background: rgba(47, 207, 138, 0.14);
  box-shadow: inset 0 0 0 1px rgba(47, 207, 138, 0.55);
}
.callout.tip > svg {
  color: var(--green-ink);
}
.callout.warning {
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px var(--amber-line);
}
.callout.warning > svg {
  color: var(--amber-ink);
}
.callout.warning code {
  color: var(--amber-ink);
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table {
  margin: 16px 0 22px;
  overflow-x: auto;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
}
.table th,
.table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th {
  background: var(--sunken);
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}
.table th:first-child {
  border-top-left-radius: 14px;
}
.table th:last-child {
  border-top-right-radius: 14px;
}
.table td {
  color: var(--ink-2);
}
.table td:first-child {
  color: var(--ink);
  font-weight: 500;
}
.table .n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Code ────────────────────────────────────────────────────────── */
.codeblock {
  margin: 16px 0 22px;
  border-radius: 14px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 6px 0 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.code-title {
  font-weight: 600;
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: 500 0.8rem/1 var(--sans);
  cursor: pointer;
}
.copy:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
.copy.done {
  color: var(--green-ink);
}
.codeblock pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font: 400 0.84rem/1.65 var(--mono);
  color: #e3f2ea;
  tab-size: 2;
}
.codeblock pre:focus-visible {
  outline-offset: -2px;
}
.t-c {
  color: #a9cdb8;
  font-style: italic;
}
.t-s {
  color: #ffd88a;
}
.t-k {
  color: #ffab9a;
}
.t-n {
  color: #a8d8ff;
}
.t-p {
  color: #8eeabf;
}
.t-f {
  color: #c9b6ff;
}
/* Tabs for a group of examples, built by docs.js. */
.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.code-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font: 500 0.8rem/1 var(--sans);
  cursor: pointer;
}
.code-tabs button:hover {
  color: var(--ink);
}
.code-tabs button[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-weight: 600;
}

/* ── On this page ────────────────────────────────────────────────── */
.docs-toc {
  display: none;
}
@media (min-width: 1280px) {
  .docs-toc {
    display: block;
    position: sticky;
    top: 76px;
    align-self: start;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    padding: 40px 0 32px;
  }
}
.toc-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.docs-toc ul,
.toc-inline ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 0.85rem;
  line-height: 1.4;
  text-decoration: none;
}
.docs-toc .l3 a {
  padding-left: 24px;
}
.docs-toc a:hover {
  color: var(--ink);
}
.docs-toc a.active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--green);
}
.toc-inline {
  margin: 22px 0 0;
  border-radius: 14px;
  background: var(--canvas);
  box-shadow: 0 0 0 1px var(--line-soft);
}
@media (min-width: 1280px) {
  .toc-inline {
    display: none;
  }
}
.toc-inline summary {
  padding: 10px 14px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 14px;
}
.toc-inline ul {
  padding: 0 14px 12px;
}
.toc-inline a {
  display: block;
  padding: 4px 0;
  color: var(--ink-2);
  font-size: 0.9rem;
  text-decoration: none;
}
.toc-inline .l3 a {
  padding-left: 14px;
}
.toc-inline a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ── End of page ─────────────────────────────────────────────────── */
.doc-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin: 48px 0 0;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.doc-cta > div {
  flex: 1 1 260px;
}
.doc-cta .cta-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.doc-cta p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.doc-cta b {
  color: var(--ink);
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.pager a {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none;
  min-width: 0;
}
.pager a:hover {
  background: var(--fill);
}
.pager .next {
  text-align: right;
  grid-column: 2;
}
.pager span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.pager b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.pager .prev b::before {
  content: '‹ ';
}
.pager .next b::after {
  content: ' ›';
}

@media (prefers-reduced-motion: reduce) {
  .doc-cards a {
    transition: none;
  }
}
.callout a {
  color: var(--ink);
}
.search-results a:hover small,
.search-results a:focus-visible small {
  color: var(--ink-2);
}
.callout.warning a {
  color: var(--amber-ink);
}
.table td:first-child code {
  white-space: nowrap;
  overflow-wrap: normal;
}
