:root {
  --surface: #fafafa;
  --surface-2: #f3f3f5;
  --ink: #16181d;
  --ink-2: #5d6170;
  --ink-3: #8f93a0;
  --rule: #efeff1;
  --rule-strong: #dedfe3;
  --accent: #3b4fd8;
  --accent-ink: #ffffff;
  --accent-wash: #eef0fd;
  --accent-hover: #3243c0;
  --accent-active: #2a39a8;
  --danger: #d4524d;
  --rail-width: 272px;
  --frame-width: 1240px;
  --gutter: clamp(32px, 4vw, 64px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0c0d10;
    --surface-2: #131419;
    --ink: #e9eaee;
    --ink-2: #a2a5b1;
    --ink-3: #737785;
    --rule: #1a1c21;
    --rule-strong: #2a2d34;
    --accent: #8d9bff;
    --accent-ink: #0c0d10;
    --accent-wash: #191d33;
    --accent-hover: #a3aeff;
    --accent-active: #b8c1ff;
  }
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font:
    16px/1.6 "Geist",
    ui-sans-serif,
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}
main a:not(.button) {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-wash);
}
code,
pre {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.875em;
}

.page {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  align-items: start;
  max-width: var(--frame-width);
  margin-inline: auto;
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  border-inline: 1px solid var(--rule);
}

.rail > * {
  padding: 28px 28px;
  border-bottom: 1px solid var(--rule);
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}
.logo {
  flex-shrink: 0;
  fill: var(--accent);
}
.rail-toggle {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.rail-toggle:hover {
  background: var(--surface-2);
}
.rail-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-link {
  position: relative;
  padding-left: 14px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rail-link:hover,
.rail-link[aria-current="page"] {
  color: var(--ink);
}
.rail-link[aria-current="page"] {
  font-weight: 500;
}

.rail-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  transform: translateY(-50%);
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.rail-link[aria-current="page"]::before {
  opacity: 1;
}

.rail-sublink {
  padding-left: 28px;
  font-size: 14px;
}
.rail-sublink::before {
  left: 14px;
}
.rail-link:not(.rail-sublink)[aria-current="page"]:has(
    ~ .rail-sublink[aria-current="page"]
  )::before {
  opacity: 0;
}

.rail .rail-index {
  gap: 0;
}
.rail-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rail-group + .rail-group {
  margin-top: 22px;
}

.rail-heading {
  margin: 0 0 12px;
  font:
    500 12px "Geist Mono",
    monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rail-index a {
  position: relative;
  display: flex;
  gap: 10px;
  padding-left: 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rail-index a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  transform: translateY(-50%);
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.rail-index a:hover,
.rail-index a[aria-current="location"] {
  color: var(--ink);
}
.rail-index a[aria-current="location"] {
  font-weight: 500;
}
.rail-index a[aria-current="location"]::before {
  opacity: 1;
}
.rail-index .num {
  font-family: "Geist Mono", monospace;
  color: var(--ink-3);
}

.rail-team-heading {
  margin: 22px 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}
.rail-user::-webkit-details-marker {
  display: none;
}
.rail-user:hover,
.rail-account[open] .rail-user {
  background: var(--surface-2);
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.rail-user-text {
  display: grid;
  min-width: 0;
}
.rail-user-name,
.rail-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-user-name {
  font-size: 13px;
  font-weight: 500;
}
.rail-user-email {
  font-size: 12px;
  color: var(--ink-3);
}

.rail > .rail-foot {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  border-bottom: 0;
}
.rail-foot {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.rail-foot a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.rail-foot a:hover {
  text-decoration: underline;
}
.rail-foot .rail-foot-link {
  color: var(--ink-3);
  font-weight: 400;
  justify-self: start;
}

.rail-account {
  position: relative;
  padding-block: 20px;
}
.rail-menu {
  position: absolute;
  inset-inline: 20px;
  bottom: calc(100% - 8px);
  z-index: 20;
  display: grid;
  padding: 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
}
.rail-menu form {
  display: contents;
}
.rail-foot .rail-menu-item {
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.rail-foot .rail-menu-item:hover,
.rail-foot .rail-menu-item[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
}
.rail-menu-built-by {
  margin-top: 6px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--rule);
}

.content {
  min-width: 0;
  min-height: 100dvh;
  border-right: 1px solid var(--rule);
}

.section {
  position: relative;
  padding: 44px var(--gutter);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 0;
}

.section > * {
  max-width: 680px;
}
.hero {
  padding-top: 72px;
  padding-bottom: 56px;
}

.section::before,
.section::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
}

.section:last-child {
  border-bottom: 0;
}
.section:last-child::before,
.section:last-child::after {
  display: none;
}

.section::before {
  left: -4px;
}
.section::after {
  right: -4px;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}
h2 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
h3 {
  margin: 28px 0 8px;
  font-size: 17px;
  font-weight: 600;
}
p {
  margin: 0 0 16px;
  color: var(--ink-2);
}
p:last-child,
ul:last-child,
pre:last-child {
  margin-bottom: 0;
}
p strong,
li strong {
  color: var(--ink);
  font-weight: 500;
}

.lede {
  font-size: 19px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--rule-strong);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.button:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--ink-3);
}
.button:active:not(:disabled) {
  background: var(--rule-strong);
}
.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.button.primary:active:not(:disabled) {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

.section-num {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font:
    500 12px "Geist Mono",
    monospace;
  color: var(--accent);
}

.section-num::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.service {
  padding: 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 500;
}

.service span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.service.live {
  background: var(--accent-wash);
}
.service.live span {
  color: var(--accent);
  font-weight: 500;
}
.service.live span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

pre {
  margin: 0 0 16px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--surface-2);
  line-height: 1.55;
}
pre code {
  font-size: inherit;
}

:not(pre) > code {
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
}

ul {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--ink-2);
}
li {
  margin-bottom: 6px;
}

button {
  font: inherit;
  cursor: pointer;
}
.hero form {
  margin-top: 20px;
}
.fine {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-3);
}
.notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  background: var(--accent-wash);
}
.notice p {
  color: var(--ink);
}
.notice pre {
  margin: 10px 0 0;
  background: var(--surface);
}
.secret {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.secret pre {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.notice.error {
  margin-top: 20px;
  border-color: var(--danger);
  background: none;
  color: var(--danger);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
}
.inline-form label {
  font-size: 14px;
  font-weight: 500;
}
.inline-form .input {
  flex: 1 1 200px;
}
.input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.input::placeholder {
  color: var(--ink-3);
}
.input:hover {
  border-color: var(--ink-3);
}
.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.service-picker {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}
.service-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.service-picker input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.world-services {
  display: inline-flex;
  vertical-align: baseline;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.world-services li {
  margin: 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  white-space: nowrap;
  padding: 8px 12px 8px 0;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-strong);
}
.data-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  white-space: nowrap;
}
.data-table td:first-child {
  color: var(--ink);
  white-space: normal;
}
.data-table td:last-child {
  text-align: right;
  padding-right: 0;
}
.form-status {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}
.form-status:empty {
  display: none;
}
.form-status.error {
  color: var(--danger);
}
button:disabled {
  opacity: 0.6;
  cursor: default;
}
.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -4px 0 16px;
}
.endpoint code {
  overflow-wrap: anywhere;
}
.endpoint code {
  font-size: 14px;
}
.endpoint-host {
  margin: -8px 0 16px;
  color: var(--ink-2);
}
.endpoint-host code {
  overflow-wrap: anywhere;
}
.method {
  padding: 2px 8px;
  font:
    600 11px "Geist Mono",
    monospace;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent);
}
.method-delete {
  background: var(--danger);
}
.method-patch,
.method-put {
  background: #b7791f;
}
.method-post {
  background: #2f855a;
}
.table-scroll {
  margin: 0 0 16px;
  overflow-x: auto;
}
.fields {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 14px;
}
.fields th {
  padding: 8px 12px 8px 0;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-strong);
}
.fields td {
  padding: 10px 12px 10px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.fields td:first-child,
.fields td:nth-child(2) {
  white-space: nowrap;
}
.optional {
  font-size: 12px;
  color: var(--ink-3);
}
.statuses {
  list-style: none;
  padding: 0;
}
.statuses code {
  margin-right: 6px;
}
.rail-group > .rail-subheading {
  margin: 0 0 2px;
}
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  text-underline-offset: 3px;
}
.text-button:hover:not(:disabled) {
  text-decoration: underline;
}
.empty {
  color: var(--ink-3);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1023.98px) {
  .page {
    display: block;
  }
  .rail {
    z-index: 10;
    height: auto;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
  }
  .rail > * {
    padding-inline: 20px;
  }
  .rail-top {
    height: 56px;
    padding-block: 0;
    border-bottom: 0;
  }
  .rail-toggle {
    display: grid;
  }
  .rail:not([data-sheet="open"]) > :not(.rail-top) {
    display: none;
  }
  .rail[data-sheet="open"] {
    position: fixed;
    inset: 0;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
  }
  .rail[data-sheet="open"] .rail-top {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
  }
  .rail[data-sheet="open"] .rail-link {
    font-size: 17px;
  }
  :root:has(.rail[data-sheet="open"]) {
    overflow: hidden;
  }
  .content {
    border: 0;
  }
  .section {
    padding: 40px 20px;
  }
  .hero {
    padding-top: 56px;
  }
  .section::before,
  .section::after {
    display: none;
  }
  .data-table th:nth-child(3),
  .data-table td:nth-child(3) {
    display: none;
  }
}

.nav-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 100;
  width: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}

.nav-progress[data-phase="loading"] {
  width: 85%;
  opacity: 1;
  transition:
    width 10s cubic-bezier(0.05, 0.8, 0.2, 1) 150ms,
    opacity 0s 150ms;
}

.nav-progress[data-phase="done"] {
  width: 100%;
  opacity: 0;
  transition:
    width 200ms ease-out,
    opacity 300ms ease 200ms;
}
