@layer htmxo {
figure.captioned { margin: 0 0 1rem 0; }
figcaption.caption { margin-bottom: 0.5rem; }
.caption-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; }
/* The title keeps 16rem beside the actions, else they wrap below it. An empty
   placeholder (the uncaptioned download header) takes no basis, so its button
   stays on the right. */
.caption-header > :first-child:not(:empty) { flex: 1 1 16rem; min-width: 0; }
.caption-actions { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.caption-long { margin-top: 0.25rem; }
.caption-long > summary { cursor: pointer; font-size: 0.9em; opacity: 0.75; }
}
/* Caption buttons — INTENTIONALLY UNLAYERED, at (0,2,0) so they beat Pico's
   unlayered button and [type=button] rules (0,0,1)/(0,1,0) in any order. */
.caption-actions > .caption-action { padding: 0.1rem 0.5rem; font-size: 0.85em; margin: 0; }
