html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

/* Keep the Radzen sidebar narrow, but wide enough for menu text in Firefox */
:root {
    --rz-sidebar-width: 190px;
}

/* Firefox-specific flexbox fixes for Radzen Layout */
@supports (-moz-appearance: none) {
    /* Mozilla Firefox */
    .rz-layout {
        display: flex;
        flex-direction: column;
        height: 100vh;
        width: 100%;
    }

    .rz-header-main {
        flex-shrink: 0;
    }

    .rz-body {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .rz-sidebar {
        flex-shrink: 0;
    }

    /* Additional Firefox fixes */
    .rz-header {
        display: flex !important;
        height: auto;
    }

    .rz-layout > * {
        min-width: 0;
    }
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

/* Firefox is stricter about flex item shrinking; keep the header controls from overlapping. */
.rz-header .rz-header-main {
    gap: 0.75rem;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    overflow: visible;
}

.rz-header .rz-header-main > * {
    flex-shrink: 1;
    min-width: auto;
}

/* Prevent specific elements from shrinking too much */
.rz-header .rz-header-main > span {
    flex-shrink: 0;
}

.gun-status {
    flex-shrink: 0;
}

.profile-label {
    flex-shrink: 0;
}

/* Ensure flex items don't overflow in Firefox */
.rz-header {
    flex-shrink: 0;
    overflow: visible;
}

/* Radzen button and split button sizing */
::deep .rz-header .rz-button,
::deep .rz-header .rz-splitbutton {
    flex-shrink: 0;
    white-space: nowrap;
}

.gun-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
}

.profile-label {
    white-space: nowrap;
}

.gun-status__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background-color: #6c757d;
    cursor: help;
}

.gun-status--online {
    color: #0f5132;
    background-color: #d1e7dd;
}

.gun-status--online .gun-status__dot {
    background-color: #198754;
}

.gun-status--offline {
    color: #664d03;
    background-color: #fff3cd;
}

.gun-status--offline .gun-status__dot {
    background-color: #ffc107;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    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%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA9PC9kZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Y29kZXttYXJnaW46IDAgMDsgfQ==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Ensure ordered list markers are visible and not clipped by narrow containers */
ol {
    list-style-position: outside; /* place numbers outside the principal content box */
    padding-left: 1.5rem; /* provide space for the number */
    margin-left: 0; /* avoid extra double-indentation */
}

/* Slight left padding for list items to keep text aligned with marker */
ol > li {
    padding-left: 0.25rem;
}

/* Defensive rule: allow overflow of markers if a container uses overflow:hidden */
.content ol {
    overflow: visible;
}