/* PyVista interactive scenes (sphinx-gallery + pyvista.ext.viewer_directive).
 *
 * The viewer directive hardcodes width='100%%' (a literal double percent, see
 * pyvista/ext/viewer_directive.py). Browsers reject that as an invalid length
 * and fall back to the default iframe width, so the scene renders in a narrow
 * box. Force a sane size here rather than patching PyVista.
 */
iframe[src*="static_viewer.html"] {
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--color-background-border);
  border-radius: 4px;
  background: #ffffff;
}

/* Keep the Static/Interactive tab panes from collapsing around the iframe. */
.sd-tab-content:has(> iframe[src*="static_viewer.html"]) {
  padding: 0;
}

/* Wide outputs (arrays, timing tables) scroll instead of pushing the page. */
.sphx-glr-script-out pre {
  overflow-x: auto;
}
