:root {
  --topbar-height: 92px;
  --topbar-compact: 60px;
  scroll-padding-top: var(--topbar-compact);
}
.topbar {
  position: sticky;
  top: calc(var(--topbar-compact) - var(--topbar-height));
  z-index: 10;
  padding-inline: max(48px, calc((100% - 1200px) / 2));
  background: var(--paper, #f7f8f3);
  flex-shrink: 0;
  color: #252c29;
  height: var(--topbar-height);
  display: flow-root;
  border-bottom: 1px solid #e7e8e2;
}
/* The space around the menu scrolls away while the row stays in view. */
.topbar-inner {
  position: sticky;
  top: 0;
  height: calc(var(--topbar-compact) - 1px);
  margin-top: calc((var(--topbar-height) - var(--topbar-compact)) / 2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
}
.brand img {
  width: 38px;
  height: 38px;
}
.brand strong {
  font-size: 25px;
  letter-spacing: -1px;
}
.brand span {
  color: #65716a;
  font-size: 12px;
  border-left: 1px solid #d6d9d1;
  padding-left: 14px;
  margin-left: 3px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}
.nav-tab {
  white-space: nowrap;
}
.nav .nav-tab[aria-current="page"] {
  color: #365b43;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.nav a {
  text-decoration: none;
}
.nav > button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 10px 0;
  color: #252c29;
}
.nav button:hover,
.nav a:hover {
  color: #a65200;
}

#api-dialog {
  padding: 0;
  border: 1px solid #e1e5da;
  border-radius: 14px;
  width: min(980px, calc(100% - 32px));
  max-height: 88svh;
  color: #252c29;
  background: #fff;
  box-shadow: 0 30px 120px #15221c33;
}
#api-dialog::backdrop {
  background: #1a291f75;
  backdrop-filter: blur(5px);
}
.dialog-head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-bottom: 1px solid #e7e8e2;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.dialog-head h2 {
  font-size: 20px;
  margin: 0;
}
.close {
  background: #f2f4ef;
  border: 1px solid #e3e6dc;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.docs {
  padding: 8px 28px 28px;
  overflow-wrap: anywhere;
}
.card {
  padding: 20px 0;
  border-bottom: 1px solid #e7e8e2;
}
.card:last-child {
  border: 0;
}
.card h2 {
  font-size: 20px;
}
.card h3 {
  color: #805012 !important;
  font-size: 16px;
}
.api-endpoint {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #e7e9e1;
  border-radius: 8px;
}
.method {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  background: #edf4e9;
  color: #33613e;
  border-radius: 4px;
}
.method.delete {
  background: #fff0eb;
  color: #9f4330;
}
.method.get {
  background: #edf1fa;
  color: #395982;
}
.endpoint-url {
  font: 12px monospace;
  margin-left: 7px;
  word-break: break-all;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 12px 0;
}
th,
td {
  border: 1px solid #e6e8e1;
  padding: 9px;
  text-align: left;
}
th {
  background: #f5f7f0;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #202a24;
  color: #e9eee8;
  padding: 18px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.8;
}
.highlight {
  padding: 12px;
  background: #fff5e4;
  font-size: 13px;
}
.docs p {
  font-size: 13px;
  line-height: 1.8;
}
body:has(#api-dialog[open]) {
  overflow: hidden;
}

.api-section-title {
  margin: 1rem 0 0.5rem;
}
.api-section-title.spaced {
  margin-top: 1.5rem;
}

@media (min-width: 901px) and (max-height: 760px) {
  :root {
    --topbar-height: 72px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
}
@media (max-width: 900px) {
  .topbar {
    padding-inline: 24px;
  }
  .brand span {
    display: none;
  }
}
@media (max-width: 680px) {
  :root {
    --topbar-height: 76px;
    --topbar-compact: 56px;
  }
  .nav {
    gap: 16px;
    font-size: 12px;
  }
  .nav #xp-user-name {
    display: none;
  }
  .brand strong {
    font-size: 22px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .dialog-head {
    padding: 16px;
  }
  .docs {
    padding: 0 14px 20px;
  }
  .api-endpoint {
    padding: 10px;
  }
  th,
  td {
    padding: 6px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .brand strong {
    display: none;
  }
  .nav {
    gap: 10px;
  }
}
@media (max-width: 400px) {
  .topbar {
    padding-inline: 12px;
  }
  .nav, .brand {
    gap: 8px;
  }
}
