:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #176b87;
  --accent-strong: #0f4f62;
  --mark: #e2f2f7;
  --shadow: 0 16px 40px rgba(31, 41, 51, 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);
  line-height: 1.65;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
}

.skip-link:focus {
  top: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

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

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.menu-button,
.back-to-top {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.menu-button {
  display: none;
  padding: 8px 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 0;
}

.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #eef3f6;
}

.search-box label,
.sidebar h2 {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-box {
  margin-bottom: 24px;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  font: inherit;
}

.sidebar ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin: 2px 0;
}

.sidebar a {
  display: block;
  border-radius: 6px;
  padding: 7px 8px;
  color: #324250;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--surface);
  color: var(--accent-strong);
}

.toc-level-2 {
  padding-left: 12px;
}

.toc-level-3,
.toc-level-4,
.toc-level-5,
.toc-level-6 {
  padding-left: 24px;
  font-size: 0.92rem;
}

.document {
  min-width: 0;
  padding: 32px clamp(20px, 5vw, 72px) 80px;
}

.doc-hero {
  margin: 0 0 28px;
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.7rem);
}

.doc-hero p:last-child {
  max-width: 840px;
  color: var(--muted);
  font-size: 1.08rem;
}

article {
  max-width: 920px;
}

article h2 {
  margin: 48px 0 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 2rem;
}

article h3 {
  margin: 36px 0 10px;
  font-size: 1.45rem;
}

article h4,
article h5,
article h6 {
  margin: 28px 0 8px;
  font-size: 1.12rem;
}

.doc-paragraph {
  margin: 0 0 16px;
  font-size: 1rem;
}

.list-like {
  padding-left: 18px;
  border-left: 3px solid var(--mark);
}

figure {
  margin: 28px 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

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

.table-wrap {
  max-width: 100%;
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: #eef7fa;
  color: var(--accent-strong);
}

.search-empty {
  display: none;
  max-width: 720px;
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.searching .search-empty {
  display: block;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

mark {
  background: #fff1a6;
  color: inherit;
}

@media (max-width: 880px) {
  .menu-button {
    display: inline-flex;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 72px 0 auto 0;
    z-index: 4;
    height: calc(100vh - 72px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .document {
    padding-top: 18px;
  }
}
