:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --panel: #ffffff;
  --panel-soft: #f0f3ec;
  --ink: #16201d;
  --muted: #61716b;
  --line: #dbe1d8;
  --accent: #2f6f5e;
  --accent-strong: #174e41;
  --code-bg: #111816;
  --code-ink: #e8f1ec;
  --warn: #8a5b13;
  --shadow: 0 18px 50px rgba(32, 45, 39, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
}

code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: #21342f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 0.08rem 0.28rem;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem;
}

pre code {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.88rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--panel-soft);
  color: #34423e;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.75rem;
}

.skip-link:focus {
  top: 1rem;
}

.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand span:not(.mark) {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.search {
  display: block;
  margin: 1.25rem 0;
}

.search span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.nav {
  display: grid;
  gap: 0.15rem;
}

.nav a {
  border-radius: 7px;
  color: #394a44;
  padding: 0.5rem 0.65rem;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  background: var(--panel-soft);
  color: var(--accent-strong);
}

.side-note {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 0.75rem;
}

.side-note span,
.section-kicker,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.content {
  max-width: 1180px;
  width: 100%;
  padding: 2rem 2.5rem 5rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0 2.25rem;
}

.topbar h1 {
  max-width: 820px;
  margin: 0.35rem 0 0.85rem;
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.topbar p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-panel div {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.status-panel div:last-child {
  border-bottom: 0;
}

.status-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-section {
  scroll-margin-top: 1rem;
  margin-top: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.doc-section[hidden] {
  display: none;
}

.doc-section h2 {
  margin: 0.35rem 0 0.65rem;
  font-size: 1.7rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.doc-section h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.doc-section p {
  max-width: 820px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tile,
.surface-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem;
}

.tile p,
.surface-list p {
  margin: 0;
}

.code-card {
  overflow: hidden;
  border: 1px solid #24332f;
  border-radius: 8px;
  background: var(--code-bg);
  box-shadow: var(--shadow);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #293934;
  background: #17211e;
  color: #b6c8c0;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}

.copy-button {
  border: 1px solid #456057;
  border-radius: 6px;
  background: #23342f;
  color: #e7f1ec;
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.55rem;
}

.copy-button:hover {
  background: #2b423b;
}

.split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.split div {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
}

.split p {
  margin: 0;
}

.callout {
  display: flex;
  gap: 0.55rem;
  align-items: start;
  margin-top: 1rem;
  border: 1px solid #e2cd9f;
  border-radius: 8px;
  background: #fff8e6;
  color: var(--warn);
  padding: 0.85rem 1rem;
}

.callout span {
  color: #5f4818;
}

.surface-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.surface-list h3 {
  color: var(--accent-strong);
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.endpoint-list code {
  background: var(--panel);
  padding: 0.38rem 0.52rem;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.footer-actions a {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--accent-strong);
  padding: 0.5rem 0.7rem;
  text-decoration: none;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content {
    padding: 1rem 1rem 4rem;
  }

  .topbar,
  .grid.two,
  .grid.three,
  .split,
  .code-grid,
  .surface-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .topbar h1 {
    font-size: 2.25rem;
  }

  th,
  td {
    padding: 0.65rem;
  }
}
