:root {
  color-scheme: light;
  --bg: #fbfaf8;
  --panel: #f2efe9;
  --text: #151515;
  --muted: #68625a;
  --line: #ded8cf;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --accent-soft: #dbece8;
  --code: #16302d;
  --code-bg: #e8f2ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 296px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  margin-bottom: 24px;
}

.brand:hover {
  text-decoration: none;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-link {
  display: block;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  padding: 7px 8px;
}

.nav-link.depth-1 {
  padding-left: 18px;
}

.nav-link.depth-2 {
  padding-left: 30px;
  font-size: 13px;
}

.nav-link[aria-current="page"] {
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 700;
}

main {
  margin-left: 296px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 10px 34px;
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.section-tab {
  flex: 0 0 auto;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 11px 13px;
}

.section-tab:hover {
  background: #fff;
  text-decoration: none;
}

.section-tab[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  font-size: 14px;
}

article {
  max-width: 980px;
  padding: 42px 46px 80px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 36px;
  margin-top: 0;
}

h2 {
  border-top: 1px solid var(--line);
  font-size: 24px;
  padding-top: 28px;
}

h3 {
  font-size: 19px;
}

p,
ul {
  margin: 0 0 1rem;
}

ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 4px;
}

code {
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  padding: 0.1em 0.35em;
}

pre {
  overflow-x: auto;
  border: 1px solid #16302d;
  border-radius: 8px;
  background: #10211f;
  color: #eef8f5;
  padding: 18px;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: #eee8df;
  font-weight: 700;
}

figure {
  margin: 22px 0 32px;
}

img {
  display: block;
  width: min(100%, 860px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

figcaption {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.hint {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  margin: 18px 0;
  padding: 14px 16px;
}

.hint.warning {
  border-left-color: #b45309;
}

.hint.info {
  border-left-color: #2563eb;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.section-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 18px;
}

.section-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.section-card strong,
.section-card span {
  display: block;
}

.section-card span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  main {
    margin-left: 0;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 22px;
  }

  .topbar-links {
    flex-wrap: wrap;
  }

  article {
    padding: 30px 22px 64px;
  }

  h1 {
    font-size: 30px;
  }

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