/* --- Stable <summary> + arrow alignment (working set) --- */

/* Keep the H4 tidy beside the arrow */
details summary h4 {
  display: inline;
  margin: 0;
  line-height: 1.3;
}

/* Stabilise the summary row */
details > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.3;
  padding: 0.25rem 0;
  cursor: pointer;

  /* Reserve fixed space on the left for our arrow */
  position: relative !important;
  padding-left: 2.0em !important; /* tweak 1.6–2.0em to taste */
}

/* Remove native markers */
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ""; }

/* Our arrow: positioned flush left in the reserved space */
details > summary::before {
  content: "▸";
  position: absolute !important;
  left: 0 !important;
  width: 1em !important;
  text-align: center !important;
  transform-origin: center;
}
details[open] > summary::before { transform: rotate(90deg); }

/* Kill hover/focus nudges */
details summary h4,
details summary h4:hover,
details summary h4:focus {
  margin: 0 !important;
  padding: 0 !important;
  text-indent: 0 !important;
  transform: none !important;
  transition: none !important;
}

/* Hide heading anchors inside summary (prevents jitter) */
details summary h1 .anchor,
details summary h2 .anchor,
details summary h3 .anchor,
details summary h4 .anchor,
details summary h1 a.header-anchor,
details summary h2 a.header-anchor,
details summary h3 a.header-anchor,
details summary h4 a.header-anchor {
  display: none !important;
}

details summary h4 a {
  pointer-events: none;
  text-decoration: none;
}