/* The object lets the SVG load its linked calculator skin. The enclosing
   link opens the original at full resolution and supplies the accessible name. */
.lcd-diagram,
.lcd-diagram object {
    display: block;
}
.lcd-diagram {
    cursor: zoom-in;
}
.lcd-diagram object {
    width: 100%;
    aspect-ratio: 5 / 3;
    pointer-events: none;
}

@media screen {
    pre.mermaid {
        overflow-x: auto;
    }
    pre.mermaid > svg {
        display: block;
        min-width: var(--readable-width, 0);
        margin-inline: auto;
    }

    .pseudocode-rendered {
        overflow-x: auto;
    }
    .pseudocode-rendered .ps-root {
        min-width: min-content;
    }
    .ps-root .ps-algorithm,
    .ps-root .ps-algorithm.with-caption > .ps-line:first-child {
        border-color: currentColor;
    }

    /* Keep the thumbnail as an overview. Open the full-size diagram for reading. */
    .content .checkbox-img:checked ~ .img-wrapper {
        overflow: auto;
        overscroll-behavior: contain;
        align-items: safe center;
        justify-content: safe center;
    }
    .content .checkbox-img:checked ~ .img-wrapper > img {
        flex: none;
        max-width: none;
        max-height: none;
    }
}

@media print {
    pre.mermaid > svg {
        /* Leave space for margins on both A4 and US Letter. */
        max-height: 9in;
    }
}
