/* Make the alabaster body width responsive instead of a fixed 800px column.
   On wide screens, leave room for the sidebar; on narrow ones, fall back to
   full width. */
@media (min-width: 1200px) {
    div.document {
        width: auto !important;
        max-width: calc(100vw - 4em) !important;
        margin: 0 auto !important;
    }
    div.body {
        max-width: none !important;
        min-width: 0 !important;
    }
    div.bodywrapper {
        margin-left: 240px !important;
    }
}

@media (max-width: 1199px) {
    div.document {
        width: auto !important;
        max-width: 100% !important;
    }
    div.body {
        max-width: none !important;
    }
}

/* Vertically centre account-type icons in the type table.
   (Sphinx copies referenced images to _images/, so we can't match by path.) */
table td img {
    vertical-align: middle;
}

/* Keep figure caption on the same page as the image (HTML — also harmless
   in PDF, where pdf.css repeats the rule). */
div.figure, figure {
    page-break-inside: avoid;
    break-inside: avoid;
}
