:root {
  color-scheme: light;
  --help-bg: #f8f8f8;
  --help-surface: #ffffff;
  --help-ink: #171717;
  --help-body: #383838;
  --help-muted: #7c7c7c;
  --help-line: #ebebeb;
  --help-accent: #417ee3;
  --help-accent-soft: #f3f6fd;
  --help-fill: #f3f3f3;
  --help-fill-hover: #ededed;
  --help-inlaid: #f5f5f5;
  --help-inlaid-hover: #eeeeee;
  --help-code: #f3f3f3;
  --help-sidebar: 18rem;
  --help-top: 56px;
  --help-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-optical-sizing: auto;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --help-bg: #171c26;
  --help-surface: #1e2533;
  --help-ink: #e8edf5;
  --help-body: #e8edf5;
  --help-muted: #9aa8bc;
  --help-line: #2f3a4d;
  --help-accent: #7aa6f5;
  --help-accent-soft: #243044;
  --help-fill: #262e3f;
  --help-fill-hover: #2c3548;
  --help-inlaid: rgba(255, 255, 255, 0.08);
  --help-inlaid-hover: rgba(255, 255, 255, 0.12);
  --help-code: #262e3f;
  --help-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--help-bg);
  color: var(--help-ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--help-accent); }
button, input, textarea { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--help-accent);
  color: #fff;
  padding: 0.4rem 0.7rem;
  z-index: 20;
  border-radius: 6px;
}
.skip-link:focus { top: 0.5rem; }
.help-shell { min-height: 100vh; display: flex; flex-direction: column; }
.help-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--help-top);
  padding: 0 1rem;
  background: var(--help-surface);
  border-bottom: 1px solid var(--help-line);
}
.contents-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--help-ink);
  padding: 6px;
  cursor: pointer;
}
.contents-toggle svg { width: 20px; height: 20px; display: block; }
.contents-toggle:hover { background: var(--help-fill); }
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.logo { display: block; width: 148px; height: auto; }
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }
.space-switch { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.space-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  text-decoration: none;
  color: var(--help-ink);
  border-radius: 10px;
  padding: 0 0.65rem 0 0.25rem;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.space-link:hover { background: var(--help-inlaid-hover); }
.space-link.is-active { background: var(--help-inlaid); }
.app-well {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--help-line);
  background: var(--help-surface);
  box-shadow: hsla(220, 30%, 5%, 0.05) 0 2px 6px;
  overflow: hidden;
}
.app-well img { width: 20px; height: 20px; display: block; border-radius: 4px; }
.top-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.sign-in,
.portal-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: 8px;
  color: var(--help-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.sign-in:hover,
.portal-link:hover { background: var(--help-fill-hover); }
.portal-link { display: none; gap: 0.35rem; }
.portal-link svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
html.is-signed-in .sign-in { display: none; }
html.is-signed-in .portal-link { display: inline-flex; }
.search-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 16rem;
  height: 36px;
  border: 0;
  background: var(--help-inlaid);
  color: var(--help-muted);
  border-radius: 8px;
  padding: 0 0.7rem;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.52s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-launch:hover { background: var(--help-inlaid-hover); }
.search-launch:focus-visible { background: var(--help-surface); box-shadow: inset 0 0 0 2px var(--help-accent); outline: none; }
.search-launch kbd {
  font-family: inherit;
  font-size: 12px;
  color: var(--help-muted);
  background: transparent;
  border: 0;
  padding: 0;
}
.theme-switch { display: inline-flex; align-items: center; cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-track {
  position: relative;
  width: 62px;
  height: 34px;
  border-radius: 17px;
  background: #aab4be;
  display: block;
}
.theme-thumb {
  position: absolute;
  top: 1px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #001e3c center / 20px 20px no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' height='20' width='20' viewBox='0 0 20 20'><path fill='%23fff' d='M9.305 1.667V3.75h1.389V1.667h-1.39zm-4.707 1.95l-.982.982L5.09 6.072l.982-.982-1.473-1.473zm10.802 0L13.927 5.09l.982.982 1.473-1.473-.982-.982zM10 5.139a4.872 4.872 0 00-4.862 4.86A4.872 4.872 0 0010 14.862 4.872 4.872 0 0014.86 10 4.872 4.872 0 0010 5.139zm0 1.389A3.462 3.462 0 0113.471 10a3.462 3.462 0 01-3.473 3.472A3.462 3.462 0 016.527 10 3.462 3.462 0 0110 6.528zM1.665 9.305v1.39h2.083v-1.39H1.666zm14.583 0v1.39h2.084v-1.39h-2.084zM5.09 13.928L3.616 15.4l.982.982 1.473-1.473-.982-.982zm9.82 0l-.982.982 1.473 1.473.982-.982-1.473-1.473zM9.305 16.25v2.083h1.389V16.25h-1.39z'/></svg>");
  transition: transform 150ms ease;
}
.theme-switch input:checked + .theme-track .theme-thumb {
  transform: translateX(16px);
  background-color: #003892;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' height='20' width='20' viewBox='0 0 20 20'><path fill='%23fff' d='M4.2 2.5l-.7 1.8-1.8.7 1.8.7.7 1.8.6-1.8L6.7 5l-1.9-.7-.6-1.8zm15 8.3a6.7 6.7 0 11-6.6-6.6 5.8 5.8 0 006.6 6.6z'/></svg>");
}
.theme-switch input:focus-visible + .theme-track { outline: 2px solid var(--help-accent); outline-offset: 2px; }
.page-tools button, .page-tools a, .feedback button {
  border: 0;
  background: transparent;
  color: var(--help-muted);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  line-height: 20px;
}
.page-tools button:hover, .page-tools a:hover { color: var(--help-accent); }
.feedback button {
  height: 36px;
  padding: 0 0.9rem;
  background: var(--help-accent);
  color: #fff;
  font-size: 14px;
  flex: none;
}
.icon-button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--help-accent);
  outline-offset: 2px;
}
.help-body {
  display: grid;
  grid-template-columns: var(--help-sidebar) minmax(0, 1fr) 16rem;
  align-items: start;
  flex: 1;
}
.sidebar {
  position: sticky;
  top: var(--help-top);
  height: calc(100vh - var(--help-top));
  overflow: auto;
  border-right: 1px solid var(--help-line);
  background: var(--help-surface);
  padding: 0.75rem 0.5rem 2rem;
}
.nav-empty { margin: 0.5rem 0.75rem; color: var(--help-muted); font-size: 14px; line-height: 1.5; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list[data-depth="1"], .nav-list[data-depth="2"], .nav-list[data-depth="3"] { padding-left: 0.75rem; }
.nav-list a {
  display: flex;
  align-items: center;
  min-height: 28px;
  color: var(--help-body);
  text-decoration: none;
  border-radius: 6px;
  padding: 0 0.5rem 0 1.25rem;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.nav-list a:hover { background: var(--help-fill); }
.nav-list a[aria-current="page"] {
  background: var(--help-fill);
  color: var(--help-ink);
  font-weight: 500;
}
.nav-group details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 28px;
}
.nav-group details > summary::-webkit-details-marker { display: none; }
.nav-group details > summary::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: center / 14px no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M7 5l6 5-6 5' fill='none' stroke='%237c7c7c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="dark"] .nav-group details > summary::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M7 5l6 5-6 5' fill='none' stroke='%239aa8bc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.nav-group details[open] > summary::before { transform: rotate(90deg); }
.nav-group details.is-shut > summary::before { transform: none; }
.nav-group summary a { padding-left: 0.15rem; flex: 1; }
.content { padding: 1.75rem 2.5rem 3rem; min-width: 0; }
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--help-muted);
  font-size: 13px;
  line-height: 1.4;
}
.crumbs a { color: var(--help-muted); text-decoration: none; }
.crumbs a:hover { color: var(--help-accent); }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; }
.article {
  max-width: 42rem;
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--help-body);
}
.article h1 {
  color: var(--help-ink);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.article h2 {
  color: var(--help-ink);
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 1.5rem 0 0.5rem;
  scroll-margin-top: 5rem;
}
.article h3 {
  color: var(--help-ink);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.008em;
  margin: 1.25rem 0 0.35rem;
  scroll-margin-top: 5rem;
}
.article p { margin: 0.65rem 0; }
.article ul, .article ol { margin: 0.75rem 0; padding-left: 1.25rem; }
.article li { margin: 0.35rem 0; }
.article img, .article video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--help-line);
}
.article img.help-zoom { cursor: zoom-in; }
.article table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 13px; line-height: 1.5; }
.article th, .article td { border: 1px solid var(--help-line); padding: 0.5rem; text-align: left; }
.article th { background: var(--help-fill); font-weight: 600; }
.article pre { overflow: auto; background: var(--help-code); padding: 0.9rem 1rem; border-radius: 8px; line-height: 1.5; }
.article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.article blockquote {
  margin: 1rem 0;
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--help-accent);
  color: var(--help-muted);
}
.empty-state { padding-top: 1rem; }
.space-cards { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.space-cards a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.9rem;
  border-radius: 8px;
  background: var(--help-surface);
  border: 1px solid var(--help-line);
  text-decoration: none;
  font-weight: 500;
}
.toc {
  position: sticky;
  top: calc(var(--help-top) + 1rem);
  padding: 0.5rem 1rem 1rem 0;
  font-size: 13px;
  line-height: 1.4;
}
.toc-title {
  margin: 0 0 0.4rem;
  color: var(--help-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { color: var(--help-muted); text-decoration: none; display: block; padding: 0.2rem 0; }
.toc a.is-active { color: var(--help-accent); }
.toc-l3 { padding-left: 0.75rem; }
.updated { color: var(--help-muted); font-size: 13px; margin: 1.5rem 0 0; }
.page-tools { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.25rem 0 0; }
.pager {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin: 2rem 0 0;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  max-width: 16rem;
  background: transparent;
  color: var(--help-ink);
}
.pager-link span { color: var(--help-muted); font-size: 12px; line-height: 1.4; }
.pager-link strong { font-weight: 500; font-size: 14px; line-height: 1.4; }
.pager-link:hover strong { color: var(--help-accent); }
.pager-next { text-align: right; margin-left: auto; align-items: flex-end; }
.pager-gap { flex: 1; }
.feedback { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--help-line); max-width: 36rem; }
.feedback-choice { display: flex; align-items: center; gap: 0.75rem; }
.thumbs { display: flex; gap: 0.35rem; }
.thumb {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--help-inlaid);
  color: var(--help-muted);
  cursor: pointer;
}
.thumb svg { width: 18px; height: 18px; display: block; }
.thumb input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.thumb:hover { background: var(--help-inlaid-hover); color: var(--help-ink); }
.thumb:has(input:checked) {
  background: var(--help-surface);
  color: var(--help-accent);
  box-shadow: inset 0 0 0 2px var(--help-accent);
}
.thumb:has(input:focus-visible) { outline: 2px solid var(--help-accent); outline-offset: 2px; }
.feedback-more { display: none; align-items: flex-start; gap: 0.5rem; margin-top: 0.75rem; }
.feedback:has(input:checked) .feedback-more { display: flex; }
.feedback-more textarea { flex: 1; }
.feedback textarea {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--help-inlaid);
  color: var(--help-ink);
  padding: 0 0.75rem;
  height: 36px;
  font-size: 14px;
  line-height: 20px;
  transition: background-color 0.52s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.feedback textarea { height: 36px; min-height: 36px; padding: 8px 0.75rem; line-height: 20px; resize: vertical; }
.feedback textarea:hover { background: var(--help-inlaid-hover); }
.feedback textarea:focus { background: var(--help-surface); box-shadow: inset 0 0 0 2px var(--help-accent); outline: none; }
.feedback-status { min-height: 1.2rem; font-size: 14px; }
.help-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--help-line);
  background: var(--help-surface);
  color: var(--help-muted);
  font-size: 12px;
  line-height: 1.4;
}
.help-footer a { color: var(--help-muted); text-decoration: none; }
.help-footer a:hover { text-decoration: underline; }
dialog {
  border: 1px solid var(--help-line);
  border-radius: 14px;
  background: var(--help-surface);
  color: var(--help-ink);
  padding: 0;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.04);
}
#search-dialog {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(640px, calc(100vw - 32px));
  overflow: hidden;
}
html[data-theme="dark"] #search-dialog {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.palette-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--help-line);
}
.palette-search-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--help-muted);
  flex: none;
}
.palette-search-icon svg { width: 20px; height: 20px; }
#search-input {
  flex: 1;
  width: auto;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--help-ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  padding: 0;
  box-shadow: none;
}
#search-input:focus, #search-input:focus-visible { outline: none; }
#search-input::-webkit-search-cancel-button,
#search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
#search-input::placeholder { color: var(--help-muted); opacity: 0.85; }
.palette-search kbd, .palette-hints kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3px;
  padding: 0.25rem 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--help-line);
  color: var(--help-muted);
  background: var(--help-fill);
}
.palette-results {
  min-height: 120px;
  max-height: min(460px, 58vh);
  overflow: auto;
  padding: 0.5rem;
}
.palette-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  min-height: 160px;
  padding: 2rem 1.5rem;
}
.palette-empty[hidden] { display: none; }
.palette-empty-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--help-ink); }
.palette-empty-subtitle { margin: 0; max-width: 22rem; font-size: 13px; line-height: 1.5; color: var(--help-muted); }
#search-results { list-style: none; margin: 0; padding: 0; }
#search-results button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  min-height: 52px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--help-ink);
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
}
#search-results button:hover, #search-results [aria-selected="true"] { background: var(--help-fill); }
.palette-item-title {
  width: 100%;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-item-meta {
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
  color: var(--help-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--help-line);
  background: var(--help-bg);
}
.palette-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem; color: var(--help-muted); font-size: 11px; }
.palette-hints span { display: inline-flex; align-items: center; gap: 0.25rem; }
#search-status { font-size: 11px; color: var(--help-muted); white-space: nowrap; }
#lightbox { width: min(60rem, calc(100vw - 2rem)); }
#lightbox img { width: 100%; height: auto; }
.hljs-keyword, .hljs-selector-tag { color: #7c3aed; }
.hljs-string, .hljs-attr { color: #047857; }
.hljs-number, .hljs-literal { color: #b45309; }
.hljs-comment { color: var(--help-muted); }
@media (max-width: 1100px) {
  .help-body { grid-template-columns: var(--help-sidebar) minmax(0, 1fr); }
  .toc { display: none; }
  .search-launch { width: auto; }
  .search-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}
@media (max-width: 800px) {
  .contents-toggle { display: inline-flex; }
  .space-switch { display: none; }
  .help-body { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    z-index: 6;
    top: var(--help-top);
    left: 0;
    width: min(18rem, 88vw);
    transform: translateX(-105%);
    visibility: visible;
    box-shadow: var(--help-shadow);
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar.is-open { transform: none; }
  .drawer-backdrop:not([hidden]) {
    position: fixed;
    inset: var(--help-top) 0 0 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 5;
  }
  .content { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-group details > summary::before,
  .sidebar { transition: none; }
}
@media print {
  .help-top, .sidebar, .toc, .page-tools, .feedback, .pager, .skip-link, .help-footer, dialog { display: none !important; }
  .help-body { display: block; }
  .content { padding: 0; }
  body { background: #fff; color: #000; }
}
