/* /Components/Layout/MainLayout.razor.rz.scp.css */
/* The shell's geometry, and nothing else.

   This file used to name two colours, in one rule, and they were the navy-to-purple gradient the
   Blazor project template paints its sidebar with, plus a block that forced white text onto it
   because MudBlazor's own dark ink was unreadable there. A literal cannot follow a palette, so
   that sidebar was the one surface in the application dark mode could never have reached, and the
   white-text block was a second layer of that same problem rather than a fix for it. Neither is
   replaced by a different literal: the drawer and the bar are MudBlazor components, and
   MudBlazor's own rules paint them from --mud-palette-drawer-background,
   --mud-palette-drawer-text and the appbar pair, which the theme provider rewrites whenever the
   palette changes. So the colours are in BrokerTheme, where they can be found and changed once,
   and what is left here is where things sit and two rules that exist because of defects.

   ::deep throughout, because the drawer, the bar and the main content are rendered by MudBlazor
   rather than by this component, and a scoped stylesheet reaches only its own component's markup.
   The wrapping .shell div in MainLayout.razor is what those selectors hang off. */

.shell[b-lxxtjhmmav]  .mud-drawer {
    /* A menu taller than a short window is unreachable past the bottom of the screen without a
       scrollbar: no bar, no way down. MudBlazor's own .mud-drawer rule already sets
       overflow-y: auto, and a fixed drawer is capped at the window's height, so the scrollbar
       appears without this. It is restated anyway: a library's internal rule is not a promise,
       and an upgrade that reorganised it would take the fix away in silence rather than with a
       build error. overscroll-behavior is ours alone and MudBlazor does not set it, and it is the
       second half of the same fix: it stops a scroll that reaches the end of the menu from
       carrying on into the page behind it, which on a touch screen is how somebody scrolling for
       the last item on the menu ends up moving the page instead. */
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Where the drawer ends. In dark mode the drawer and the page are two near-blacks a shade
       apart, which without a line read as one surface. The theme's own line variable rather than
       a literal, so light and dark each get the right one from a single rule. */
    border-right: 1px solid var(--mud-palette-lines-default);
}

/* The same reasoning for the bar, whose background and the page's are deliberately the same value
   in dark mode. */
.shell[b-lxxtjhmmav]  .mud-appbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.shell[b-lxxtjhmmav]  .mud-main-content {
    /* Several screens in this application (job history, product and rate tables) hold a table set
       to min-width: max-content inside a div set to overflow-x: auto, which is meant to scroll the
       table and leave the page alone. A container that refuses to be narrower than its content
       takes that scrolling away from the div and hands it to the page: the whole page becomes
       wider than the window, and reading a column at the far right of a wide table scrolls the
       menu off the side.

       That would happen if the content sat in a flex row beside the drawer, because a flex item
       defaults to min-width: auto. The structure does not have that shape: .mud-layout is a plain
       block and the main content is offset from the drawer by a margin rather than by being a
       flex sibling of it, so a block-level container takes its width from its parent and cannot
       grow to its content. This rule is therefore belt as well as braces, written down so the next
       person to restructure this shell can find the reason rather than rediscover it. */
    min-width: 0;
}

/* Breathing room under the bar, and the whole of what is left of a class the Blazor template put
   in a global stylesheet. It lived in app.css, which is now only the Bootstrap the statically
   rendered Identity pages are written in, and "content" is far too general a name to leave in a
   file every page on the site loads. No ::deep, because main.content is the one element in this
   shell that MainLayout renders itself.

   MudMainContent already offsets the fixed bar's own height. This is the gap between that and the
   first line of the page. */
.content[b-lxxtjhmmav] {
    padding-top: 1.1rem;
}

#blazor-error-ui[b-lxxtjhmmav] {
    /* Deliberately outside the theme. This is what the browser shows once the circuit is gone,
       which is the one moment the application is not in a position to be consistent about
       anything, so it stays the template's plain yellow band in light regardless of the palette.

       The ink is named because the band only named its background. MudBlazor sets
       color: var(--mud-palette-text-primary) on body, so this text was inherited, and in dark mode
       that variable is #E6E9EC: near white on lightyellow, which is 1.19:1 and gone. color-scheme
       does not save it, since that governs what the browser paints for itself rather than what a
       stylesheet inherits. The value is the light palette's own ink rather than a new colour, and
       it is written literally here for the same reason the background is: this band has to read
       correctly when the application behind it has stopped. */
    color-scheme: light only;
    background: lightyellow;
    color: #1A1D21;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;

    /* Above everything MudBlazor draws, whose layers run from the drawer at 1100 to the tooltip
       at 1600. The template's own value was 1000, which was above the old sidebar because that had
       no layer of its own, and would now be underneath the drawer: the banner runs along the foot
       of the window, so the first inch of "An unhandled error has occurred" would sit behind the
       menu. A message saying the application has stopped working is the one thing that must not be
       covered by the application. */
    z-index: 2000;
}

    #blazor-error-ui .dismiss[b-lxxtjhmmav] {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
.components-reconnect-first-attempt-visible[b-752tne3t4o],
.components-reconnect-repeated-attempt-visible[b-752tne3t4o],
.components-reconnect-failed-visible[b-752tne3t4o],
.components-pause-visible[b-752tne3t4o],
.components-resume-failed-visible[b-752tne3t4o],
.components-rejoining-animation[b-752tne3t4o] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-retrying[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-failed[b-752tne3t4o],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-752tne3t4o] {
    display: block;
}


#components-reconnect-modal[b-752tne3t4o] {
    /* Light on purpose and self-contained, for the same reason the disconnection banner in
       MainLayout.razor.css is: this is what somebody sees while the circuit is dropping, so it
       must not depend on the application being in a fit state to colour it.

       The ink is named because the dialog only named its background. MudBlazor sets
       color: var(--mud-palette-text-primary) on body and a dialog inherits from it, so once
       BrokerTheme's dark palette exists, "Rejoining the server" would be #E6E9EC on white, which
       is 1.22:1 and invisible: a reconnect message nobody can read is indistinguishable from the
       page having simply stopped. */
    color-scheme: light only;
    background-color: white;
    color: #1A1D21;
    width: 20rem;
    margin: 20vh auto;
    padding: 2rem;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-752tne3t4o 0.5s both;
    &[open]

{
    animation: components-reconnect-modal-slideUp-b-752tne3t4o 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity-b-752tne3t4o 0.5s ease-in-out 0.3s;
    animation-fill-mode: both;
}

}

#components-reconnect-modal[b-752tne3t4o]::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity-b-752tne3t4o 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp-b-752tne3t4o {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity-b-752tne3t4o {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity-b-752tne3t4o {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container[b-752tne3t4o] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#components-reconnect-modal p[b-752tne3t4o] {
    margin: 0;
    text-align: center;
}

/* The Retry button. Still a literal, for the reason the dialog above states: this is drawn while
   the circuit is going, so it cannot depend on a variable the application is no longer in a
   position to have set. What changed is which literal.

   It was the project template's own #6b9ed2, and that was two faults at once. It is a blue that
   appears nowhere else in this application, on the one control somebody presses when things have
   already gone wrong, so the application looked least like itself at the moment it most needed to
   look trustworthy. And its label failed to read: white on #6b9ed2 is 2.82:1, well under the 4.5:1
   text on a control needs. This is BrokerTheme's own light-mode accent, written out rather than
   read from --mud-palette-primary, and white on it is 6.75:1. The hover is that accent darkened by
   a quarter, at 9.70:1. */
#components-reconnect-modal button[b-752tne3t4o] {
    border: 0;
    background-color: #2C5F8A;
    color: white;
    padding: 4px 24px;
    border-radius: 4px;
}

    #components-reconnect-modal button:hover[b-752tne3t4o] {
        background-color: #214768;
    }

    #components-reconnect-modal button:active[b-752tne3t4o] {
        background-color: #2C5F8A;
    }

.components-rejoining-animation[b-752tne3t4o] {
    position: relative;
    width: 80px;
    height: 80px;
}

    .components-rejoining-animation div[b-752tne3t4o] {
        position: absolute;
        /* The same accent as the button, for the same reason and with the same caveat about being
           written out rather than read from the palette. The template's #0087ff was a bright blue
           belonging to nothing else in the application. */
        border: 3px solid #2C5F8A;
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation-b-752tne3t4o 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2)[b-752tne3t4o] {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation-b-752tne3t4o {
    0% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 40px;
        left: 40px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0px;
        left: 0px;
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}
