.editable-div {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    overflow-y: auto;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.variableGray {
    background-color: #d3d3d3;
    color: #000;
    border-radius: 10px;
    padding: 0.2em 0.4em;
}

.variableRed {
    background-color: #ffcccc;
    color: #000;
    border-radius: 10px;
    padding: 0.2em 0.4em;
}

.monaco-editor-container { /* for all editor instances */
    height: 35rem;
}

/* Blazor Server Reconnect UI */
#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal .show,
#components-reconnect-modal .failed,
#components-reconnect-modal .rejected {
    display: none;
}

/* Visibility Logic - Higher priority states override lower ones */

/* 1. Rejected (Terminal state) */
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}
#components-reconnect-modal.components-reconnect-rejected .rejected {
    display: block;
}
#components-reconnect-modal.components-reconnect-rejected .show,
#components-reconnect-modal.components-reconnect-rejected .failed {
    display: none !important;
}

/* 2. Failed (Retry state) - Only if not rejected */
#components-reconnect-modal.components-reconnect-failed:not(.components-reconnect-rejected) {
    display: flex;
}
#components-reconnect-modal.components-reconnect-failed:not(.components-reconnect-rejected) .failed {
    display: block;
}
#components-reconnect-modal.components-reconnect-failed:not(.components-reconnect-rejected) .show {
    display: none !important;
}

/* 3. Show (Attempting) - Only if not failed and not rejected */
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-failed):not(.components-reconnect-rejected) {
    display: flex;
}
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-failed):not(.components-reconnect-rejected) .show {
    display: block;
}

/* Hide overrides everything else */
#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

#components-reconnect-modal .reconnect-modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
}

#components-reconnect-modal .reconnect-modal-content p {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1rem;
}

/* Spinner animation */
.reconnect-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7e57c2;
    border-radius: 50%;
    animation: reconnect-spin 1s linear infinite;
}

@keyframes reconnect-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.reconnect-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border: none;
    border-radius: 4px;
    background-color: #7e57c2;
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reconnect-button:hover {
    background-color: #5e35b1;
}

/* Bootstrap-compat utilities (previously provided by tailwind-input.css) */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.text-end { text-align: end; }
/* Image-order select: keep the collapsed selected value tall enough for the thumbnail */
.image-order-select .mud-input-slot,
.image-order-select .mud-select-input {
    height: auto;
    min-height: 56px;
    display: flex;
    align-items: center;
}

/* Motive picker: type dropdown and motive input read as one segmented control */
.motive-select {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.motive-select > .motive-select-type {
    flex: 0 0 11rem;
    min-width: 0;
}

.motive-select > .motive-select-value {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: -1px;
}

.motive-select .motive-select-type .mud-input-outlined-border {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.motive-select .motive-select-value .mud-input-outlined-border {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* The focused half paints its border above the neighbour instead of behind it */
.motive-select .mud-input-control:focus-within {
    position: relative;
    z-index: 1;
}

/* Compact type dropdown living in the chip input's header row.
   Shrinks with the card and drops to its own line when the label leaves no room. */
.motive-type-inline {
    flex: 1 1 7rem;
    max-width: 10rem;
    margin: 0;
}

.motive-type-inline .mud-input-control {
    margin-top: 0;
}

/* Approval tabs keep their generous minimum width only where there is room for it.
   Below the md breakpoint the tabs shrink instead of scrolling the whole page. */
@media (min-width: 960px) {
    .approval-tab-header .mud-tab {
        min-width: 16rem !important;
    }
}

/* Wide tables scroll on their own instead of widening the page.
   min-width: 0 lets the element shrink inside its flex parent so overflow-x can apply. */
.panda-scroll-x {
    min-width: 0;
    overflow-x: auto;
}

/* Mass approval buttons sit side by side on desktop and stack full width on mobile. */
@media (max-width: 959.98px) {
    .mass-approval-actions {
        flex-direction: column;
    }

    .mass-approval-actions > .mud-button-root {
        width: 100%;
    }
}
