.iconvectors-help {
  --help-bg: #fafafa;
  --help-panel: #fff;
  --help-text: #3f3f46;
  --help-heading: #18181b;
  --help-muted: #52525b;
  --help-border: #d4d4d8;
  --help-soft: #f4f4f5;
  --help-link: #1d4ed8;
  --help-selected: #eff6ff;
  --help-menu-edge: #94b8eb;
  --help-key-bg: #fff;
  --help-key-edge: #71717a;
  --help-literal: #b00000;
  --help-literal-bg: #fff;
  --help-literal-border: #b8b8b8;
  --help-header-offset: 5.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--help-bg);
  color: var(--help-text);
  color-scheme: light;
}

.dark .iconvectors-help {
  --help-bg: #27272a;
  --help-panel: #18181b;
  --help-text: #e4e4e7;
  --help-heading: #fafafa;
  --help-muted: #a1a1aa;
  --help-border: #52525b;
  --help-soft: #27272a;
  --help-link: #93c5fd;
  --help-selected: #172c4c;
  --help-menu-edge: #587fb7;
  --help-key-bg: #34343e;
  --help-key-edge: #92929f;
  --help-literal: #fda4af;
  --help-literal-bg: #000;
  --help-literal-border: #808080;
  color-scheme: dark;
}

/* Neutralize Sphinx's global visited color so shared navigation keeps its palette. */
:where(.iconvectors-help) a:visited { color: inherit; }
:where(.iconvectors-help) a:visited:where(.text-white) { color: #fff; }

.help-skip {
  position: fixed;
  inset: .5rem auto auto .5rem;
  z-index: 60;
  transform: translateY(-150%);
  padding: .5rem 1rem;
  background: var(--help-panel);
  color: var(--help-link);
}

.help-skip:focus { transform: none; }

.help-shell {
  width: 100%;
  max-width: calc(72rem + 100px);
  margin-inline: auto;
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem) 3rem;
  flex: 1;
}

.help-shell :focus-visible {
  outline: 2px solid var(--help-link);
  outline-offset: 2px;
}

.help-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  margin-bottom: 1rem;
}

.help-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  color: var(--help-muted);
  font-size: .875rem;
}

.help-crumbs a:hover { color: var(--help-link); text-decoration: underline; }
.help-crumbs [aria-current] { color: var(--help-heading); }

.help-search, .help-prose form:has(input[name="q"]) {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.help-search { flex-wrap: nowrap; }

.help-search input, .help-prose input[name="q"] {
  min-width: 0;
  width: 15rem;
  border: 1px solid var(--help-border);
  border-radius: .5rem;
  padding: .45rem .75rem;
  background: var(--help-panel);
  color: var(--help-heading);
}

.help-search button, .help-prose input[type="submit"] {
  padding: .45rem .85rem;
  border-radius: .5rem;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
}

.help-search button:hover, .help-prose input[type="submit"]:hover { background: #1e40af; }

.help-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.help-sidebar, .help-card {
  min-width: 0;
  background: var(--help-panel);
  border: 1px solid var(--help-border);
  border-radius: .875rem;
}

#help-topics > summary {
  padding: .75rem 1rem;
  font-weight: 700;
  color: var(--help-heading);
}

#help-topics > summary { cursor: pointer; }
.help-topics { padding: .375rem .625rem .75rem; font-size: .875rem; }
.help-topics .caption {
  margin: 0;
  padding: .55rem .375rem;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: var(--help-link);
}

.help-topics > ul + .caption { border-top: 1px solid var(--help-border); }
.help-topics > ul { margin: 0 0 .5rem .375rem; }

.help-branch-toggle::before {
  content: '';
  flex: none;
  width: .42em;
  height: .42em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.help-branch-toggle[aria-expanded="true"]::before {
  transform: rotate(45deg);
}

.help-branch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.75rem;
  align-items: start;
}
.help-branch > ul { grid-column: 1 / -1; }
.help-branch-toggle {
  display: grid;
  min-height: 1.75rem;
  place-items: center;
  border-radius: .375rem;
  color: var(--help-link);
  cursor: pointer;
}
.help-branch-toggle:hover { background: var(--help-selected); }

.help-topics ul ul {
  margin-left: .75rem;
  padding-left: .375rem;
  border-left: 1px solid var(--help-border);
}

.help-topics a {
  display: block;
  padding: .25rem .375rem;
  line-height: 1.35;
  border-radius: .375rem;
}

.help-topics a:hover, .help-topics a[aria-current] {
  background: var(--help-selected);
  color: var(--help-link);
}

.help-topics a[aria-current] { font-weight: 700; }
.help-topics a[aria-current]:visited { color: var(--help-link); }

.help-prose {
  padding: clamp(1rem, 3.5vw, 2.5rem);
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.help-prose, .help-prose [id] { scroll-margin-top: var(--help-header-offset); }
.help-prose p, .help-prose ul, .help-prose ol, .help-prose dl,
.help-prose figure, .help-prose .highlight, .help-prose table { margin-bottom: 1rem; }
.help-prose ul, .help-prose ol { padding-left: 1.5rem; }
.help-prose ul { list-style: disc; }
.help-prose ol { list-style: decimal; }
.help-prose li > :is(p, ul, ol) { margin-bottom: .35rem; }
.help-prose dd { margin-left: 1.25rem; }
.help-prose dt { font-weight: 700; }
.help-prose a { color: var(--help-link); text-decoration: underline; text-underline-offset: .15em; }
.help-prose a:hover { text-decoration-thickness: 2px; }
.help-prose :is(h1, h2, h3, h4, h5, h6) {
  margin: 1.5em 0 .5em;
  color: var(--help-heading);
  font-weight: 700;
  line-height: 1.2;
}
.help-prose h1 { margin-top: 0; font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
.help-prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
.help-prose h3 { font-size: 1.25rem; }
.help-prose .toctree-wrapper > .caption { margin-top: 1.25rem; font-weight: 700; color: var(--help-heading); }
.help-prose .headerlink { margin-left: .3em; font-size: .75em; text-decoration: none; }
.help-prose img, .help-prose video { max-width: 100%; height: auto; }
/* The tool glyphs are black SVGs with transparent backgrounds. */
.dark .help-prose img:is([src$="/SelectionTool.svg"], [src$="/PenTool.svg"], [src$="/TextTool.svg"]) {
  filter: invert(.92);
}
.help-prose figure {
  float: none;
  margin: 1.5rem auto;
  text-align: center;
}
.help-prose figure img { display: block; margin-inline: auto; }
.help-prose figcaption {
  max-width: min(100%, 58ch);
  margin: .75rem auto 0;
  color: var(--help-muted);
  font-size: .9375rem;
  font-style: italic;
  line-height: 1.5;
}
.help-prose figcaption > :last-child { margin-bottom: 0; }
.dark .help-prose figure img:is([src$=".png"], [src$=".jpg"], [src$=".jpeg"], [src$=".webp"], [src$=".gif"]) {
  border-radius: .25rem;
  outline: 1px solid #666677;
  box-shadow: 0 .5rem 1.25rem #0008;
  filter: contrast(1.04) brightness(1.15);
}
.help-prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--help-border); }
.help-prose :is(.admonition, .topic) {
  margin: 1rem 0;
  padding: .75rem 1rem;
  background: var(--help-selected);
  border-inline-start: 3px solid var(--help-link);
  border-radius: .375rem;
}
.help-prose :is(.admonition, .topic) > :last-child { margin-bottom: 0; }
.help-prose code, .help-prose pre { font-size: .9em; }
.help-prose code:not(pre code) {
  padding: .1em calc(.35em + 1px);
  border: 1px solid var(--help-literal-border);
  border-radius: .25rem;
  background: var(--help-literal-bg);
  color: var(--help-literal);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.help-prose :is(.menuselection, .guilabel) {
  padding: calc(.06em + 1px) calc(.4em + 1px);
  border: 1px solid var(--help-menu-edge);
  border-radius: .3em;
  background: var(--help-selected);
  color: var(--help-link);
  font-size: calc(1em - 1px);
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.help-prose .menuselection {
  padding-bottom: calc(.06em + 2px);
  font-weight: 500;
}
.help-prose kbd.kbd {
  margin-inline: 2px;
  padding: calc(.05em + 1px) calc(.35em + 1px);
  border: 1px solid var(--help-key-edge);
  border-bottom-width: 2px;
  border-radius: .3em;
  background: var(--help-key-bg);
  color: var(--help-heading);
  font-size: .85em;
  white-space: nowrap;
}
.help-prose code .pre { white-space: normal; }
.help-prose pre {
  max-width: 100%;
  overflow-x: auto;
  line-height: 1.6;
  padding: .75rem 1rem;
  border: 1px solid var(--help-border);
  border-radius: .5rem;
  background: var(--help-soft);
}
.help-prose .highlight { background: transparent; }
.dark .help-prose .highlight span { color: var(--help-text); }
.dark .help-prose .highlight :is(.c, .c1, .cm, .cp, .cs) { color: #a1a1aa; }
.dark .help-prose .highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .nt, .nf) { color: #c4b5fd; }
.dark .help-prose .highlight :is(.s, .s1, .s2, .sa, .sb, .sd, .se, .sh, .si, .sr, .sx) { color: #86efac; }
.dark .help-prose .highlight :is(.m, .mb, .mf, .mh, .mi, .mo, .na) { color: #93c5fd; }
.help-prose .highlighted { color: #27272a; background: #fde68a; }
.help-prose table.docutils { width: 100%; border-collapse: collapse; }
.help-prose table.docutils :is(td, th) { padding: .5rem; border: 1px solid var(--help-border); vertical-align: top; }
.help-prose table.docutils th { background: var(--help-soft); color: var(--help-heading); }
.help-prose table.docutils tr :is(td, th) > :last-child { margin-bottom: 0; }

.help-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem clamp(1rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--help-border);
}
.help-pagination a { flex: 1 1 12rem; color: var(--help-link); }
.help-pagination a:hover { text-decoration: underline; }
.help-pagination a[rel="next"] { text-align: right; }
.help-pagination span { display: block; font-size: .8125rem; color: var(--help-muted); }

@media (max-width: 35rem) {
  .help-search { width: 100%; }
  .help-search input { flex: 1; }
  .help-prose input[name="q"] { max-width: 100%; }
}

@media (min-width: 56rem) {
  .help-grid { grid-template-columns: calc(14.5rem + 50px) minmax(0, 1fr); gap: 1.25rem; }
  .help-sidebar {
    position: sticky;
    top: var(--help-header-offset);
    max-height: calc(100vh - var(--help-header-offset) - 1rem);
    overflow: auto;
  }
  #help-topics > summary { display: none; }
}

/* The full site menu needs more space than the general desktop breakpoint. */
@media (min-width: 48rem) and (max-width: 66rem) {
  .iconvectors-help #nav-menu { display: none; }
  .iconvectors-help #menu-toggle { display: block; }
  .iconvectors-help #mobile-menu:not(.hidden) { display: block; }
}
