:root {
  color-scheme: light;
  --bg: #ffffff;
  --header: rgba(255, 255, 255, 0.9);
  --sidebar: #fafafa;
  --surface: #f6f6f7;
  --surface-strong: #eeeeef;
  --border: #e2e2e3;
  --border-soft: #eeeeef;
  --text: #213547;
  --heading: #1f2328;
  --muted: #67676c;
  --muted-2: #8e8e93;
  --accent: #3b73d1;
  --accent-hover: #285daf;
  --accent-soft: #edf4ff;
  --accent-border: #c9dcfb;
  --code-bg: #f6f8fa;
  --code-text: #24292f;
  --success: #237a45;
  --warning: #8a5b00;
  --header-height: 64px;
  --sidebar-width: 272px;
  --toc-width: 224px;
  --content-width: 752px;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.04), 0 8px 24px rgba(66, 74, 83, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b1f;
  --header: rgba(27, 27, 31, 0.9);
  --sidebar: #17171a;
  --surface: #242428;
  --surface-strong: #2b2b30;
  --border: #34343a;
  --border-soft: #29292e;
  --text: #c9c9d1;
  --heading: #f0f0f2;
  --muted: #a1a1aa;
  --muted-2: #767680;
  --accent: #79a8ff;
  --accent-hover: #9abdff;
  --accent-soft: #202d42;
  --accent-border: #344e74;
  --code-bg: #141417;
  --code-text: #d7dae0;
  --success: #72c68f;
  --warning: #e2b65d;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1b1f;
    --header: rgba(27, 27, 31, 0.9);
    --sidebar: #17171a;
    --surface: #242428;
    --surface-strong: #2b2b30;
    --border: #34343a;
    --border-soft: #29292e;
    --text: #c9c9d1;
    --heading: #f0f0f2;
    --muted: #a1a1aa;
    --muted-2: #767680;
    --accent: #79a8ff;
    --accent-hover: #9abdff;
    --accent-soft: #202d42;
    --accent-border: #344e74;
    --code-bg: #141417;
    --code-text: #d7dae0;
    --success: #72c68f;
    --warning: #e2b65d;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.7; }
body.sidebar-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 10px; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--header);
  backdrop-filter: blur(14px) saturate(1.4);
}
.header-brand {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 24px;
  color: var(--heading);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.header-brand:hover { color: var(--heading); }
.brand-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: url("icon.png") center / contain no-repeat;
}
.header-content {
  height: 100%;
  min-width: 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.header-link, .icon-button, .version-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.header-link { padding: 0 10px; }
.header-link:hover { background: var(--surface); color: var(--heading); }
.version-pill { padding: 0 10px; background: var(--surface); color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }
.icon-button {
  width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--surface); color: var(--heading); }
.icon-button svg { width: 18px; height: 18px; fill: currentColor; }
.menu-button { display: none; }

.docs-shell {
  min-height: 100vh;
  padding-top: var(--header-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.docs-sidebar {
  position: fixed;
  z-index: 40;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  padding: 28px 20px 44px;
  border-right: 1px solid var(--border-soft);
  background: var(--sidebar);
  scrollbar-width: thin;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-section h2 {
  margin: 0 10px 8px;
  color: var(--heading);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}
.sidebar-section a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.sidebar-section a:hover { color: var(--heading); background: var(--surface); }
.sidebar-section a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.sidebar-meta { margin: 34px 10px 0; color: var(--muted-2); font-size: 12px; line-height: 1.55; }

.sidebar-backdrop { display: none; }
.docs-stage { grid-column: 2; min-width: 0; }
.docs-grid {
  width: min(100%, calc(var(--content-width) + var(--toc-width) + 112px));
  margin: 0 auto;
  padding: 60px 40px 96px;
  display: grid;
  grid-template-columns: minmax(0, var(--content-width)) var(--toc-width);
  gap: 72px;
  justify-content: center;
}
.docs-content { min-width: 0; }
.page-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}
.docs-content h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 750;
}
.page-description {
  margin: 18px 0 36px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}
.docs-content h2 {
  margin: 54px 0 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  color: var(--heading);
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.docs-content h3 {
  margin: 32px 0 10px;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.45;
}
.docs-content p { margin: 0 0 18px; }
.docs-content strong { color: var(--heading); }
.docs-content ul, .docs-content ol { margin: 0 0 22px; padding-left: 24px; }
.docs-content li { margin: 6px 0; padding-left: 3px; }
.docs-content a { font-weight: 550; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent); text-underline-offset: 3px; }
.docs-content hr { margin: 48px 0; border: 0; border-top: 1px solid var(--border); }

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0;
}
.quick-link {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--shadow);
  text-decoration: none !important;
}
.quick-link:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.quick-link strong { display: block; margin-bottom: 4px; }
.quick-link span { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.5; }

.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
}
.callout strong { display: block; margin-bottom: 3px; }
.callout p { margin: 0; color: var(--muted); }
.callout.warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: color-mix(in srgb, var(--warning) 8%, var(--bg)); }

.code-block {
  position: relative;
  margin: 18px 0 24px;
  padding: 18px 56px 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre;
}
.copy-code {
  position: absolute;
  top: 9px;
  right: 9px;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.copy-code:hover { color: var(--heading); border-color: var(--accent-border); }
.inline-code, .docs-content :not(pre) > code {
  padding: 0.15em 0.38em;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--code-text);
  font-size: 0.88em;
}

.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.reference-grid > div { padding: 15px 16px; border: 1px solid var(--border); border-radius: 8px; }
.reference-grid strong, .reference-grid span { display: block; }
.reference-grid span { margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.table-wrap { margin: 24px 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--heading); background: var(--surface); font-size: 12px; letter-spacing: 0.02em; }
.status-complete { color: var(--success); font-weight: 700; white-space: nowrap; }
.status-local { color: var(--accent); font-weight: 700; white-space: nowrap; }

.page-nav {
  margin-top: 64px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
}
.page-nav a { text-decoration: none; font-size: 14px; }
.page-nav a:last-child { margin-left: auto; text-align: right; }
.page-footer { margin-top: 48px; color: var(--muted-2); font-size: 12px; }

.page-toc { position: sticky; top: calc(var(--header-height) + 36px); align-self: start; }
.page-toc h2 { margin: 0 0 10px; color: var(--heading); font-size: 13px; }
.page-toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.page-toc a:hover, .page-toc a.active { color: var(--accent); border-left-color: var(--accent); }

@media (max-width: 1100px) {
  .docs-grid { grid-template-columns: minmax(0, var(--content-width)); }
  .page-toc { display: none; }
}

@media (max-width: 800px) {
  :root { --header-height: 58px; }
  .site-header { grid-template-columns: 1fr auto; }
  .header-brand { padding: 0 16px; }
  .header-content { padding: 0 12px 0 0; }
  .header-link, .version-pill { display: none; }
  .menu-button { display: inline-flex; }
  .docs-shell { display: block; }
  .docs-stage { width: 100%; }
  .docs-sidebar {
    top: var(--header-height);
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open .docs-sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed;
    z-index: 35;
    inset: var(--header-height) 0 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .docs-grid { padding: 42px 24px 72px; }
}

@media (max-width: 560px) {
  .docs-grid { padding-inline: 18px; }
  .docs-content h1 { font-size: 36px; }
  .page-description { font-size: 17px; }
  .quick-links, .reference-grid { grid-template-columns: 1fr; }
  .code-block { margin-inline: -4px; padding-left: 14px; }
  .page-nav { align-items: flex-start; flex-direction: column; }
  .page-nav a:last-child { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
