/* Full-screen mode for the AI pages.
 *
 * Not scoped CSS: the same rules are used by AgentConsole (in BudgetSoft2.Client) and by
 * StatementImportPage, and a scoped copy in each would drift apart.
 *
 * The layout contract is a column flexbox pinned to the viewport, where exactly one child grows and
 * scrolls. `min-height: 0` on that child is the load-bearing part — a flex item's default
 * `min-height: auto` refuses to shrink below its content, so without it the log grows past the
 * viewport and the *page* scrolls instead of the log, which is the one thing this is meant to stop.
 */

.sb-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1045; /* under Bootstrap's modal (1055), so a dialog still lands on top */
    background-color: #fff;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* The one child allowed to take the leftover height. Its own scroll container lives inside. */
.sb-fullscreen .sb-fullscreen-grow {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* A card used as the growing child: its body is what actually scrolls, not the card. */
.sb-fullscreen .sb-fullscreen-grow > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* Beats the inline `height`/`max-height` the components carry for their windowed size, which
       would otherwise cap the log well short of the viewport. */
    height: auto !important;
    max-height: none !important;
}

/* Everything that is not the growing child keeps its natural height. */
.sb-fullscreen > *:not(.sb-fullscreen-grow) {
    flex: 0 0 auto;
}

.sb-fullscreen-toggle {
    background: none;
    border: 0;
    padding: 0 0.25rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}

.sb-fullscreen-toggle:hover,
.sb-fullscreen-toggle:focus-visible {
    color: #0d6efd;
}
