/* Explicit alignment keeps single-label disclosures centered in every engine.
   The shared summary rule distributes multiple items across a row. */
html body main .flow-plan-check > summary,
html body main .mz-video-transcript > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  margin-inline: auto;
  text-align: center;
  list-style: none;
}
html body main .flow-plan-check > summary::after,
html body main .mz-video-transcript > summary::after {
  content: none;
  display: none;
}
html body main .flow-plan-check > summary::-webkit-details-marker,
html body main .mz-video-transcript > summary::-webkit-details-marker {
  display: none;
}
html body main .flow-plan-check > summary::marker,
html body main .mz-video-transcript > summary::marker {
  content: "";
}

.mz-clarity-home .sim-actions > :only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: auto;
  max-width: 100%;
}

/* Four half-width tracks preserve card widths and center a final lone fact. */
@media (min-width: 761px) {
  .mz-flow-page .flow-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mz-flow-page .flow-facts > div {
    grid-column: span 2;
  }
  .mz-flow-page .flow-facts > div:last-child:nth-child(odd) {
    grid-column: 2 / span 2;
  }
}

/* Resource cards keep the same width when the final row has a single card. */
@media (min-width: 641px) {
  .mz-resource-grid > .mz-resource-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 18px) / 2);
    box-sizing: border-box;
  }
}

/* A final section link stays the width of its peers in two-column menus. */
@media (max-width: 760px) {
  .mz-section-menu :is(.toc, .mz-doc-toc) > a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 8px) / 2);
    box-sizing: border-box;
  }
}

/* Five chips form a centered three-plus-two layout on narrow phones. */
@media (max-width: 350px) {
  .mz-flow-demo-scenarios {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .mz-flow-demo-scenarios > button {
    grid-column: span 2;
  }
  .mz-flow-demo-scenarios > button:nth-child(4):nth-last-child(2) {
    grid-column: 2 / span 2;
  }
  .mz-flow-demo-scenarios > button:nth-child(5):last-child {
    grid-column: 4 / span 2;
  }
}

/* Consistent native page navigation. In-page transitions are unchanged. */
@view-transition { navigation: none; }
