h1:focus {
    outline: none;
}

/* Hide MudBlazor custom spin buttons on all number inputs */
.mud-input-control.mud-input-number-control .mud-input-numeric-spin {
    display: none;
}

/* =============================================================================
   WinGLUE mode: compact density overrides for MDI panels (.window-body)
   Scoped to .window-body — Dashboard mode, menus, and dialogs are unaffected.
   ============================================================================= */

/* Font size */
.window-body,
.window-body * {
    font-size: 0.8rem !important;
}

/* Input fields */
.window-body .mud-input-control { margin-bottom: 0 !important; }
.window-body .mud-input { min-height: 24px !important; }
.window-body .mud-input-label { top: 4px !important; }
.window-body .mud-input-label-inputcontrol { top: 4px !important; }
.window-body .mud-input.mud-input-outlined .mud-input-slot { padding: 4px 8px !important; }
.window-body .mud-input.mud-input-text { padding: 4px 0 !important; }
.window-body .mud-input-slot { padding-bottom: 2px !important; padding-top: 2px !important; }
.window-body .mud-input input { padding-bottom: 1px !important; padding-top: 1px !important; }
.window-body .mud-input-underline { padding-bottom: 1px !important; }

/* Table cells */
.window-body .mud-table-cell { padding: 2px 6px !important; }
.window-body .mud-table-head .mud-table-cell { padding: 2px 6px !important; }

/* Expansion panel headers & content */
.window-body .mud-expand-panel-header { min-height: 28px !important; padding: 4px 8px !important; }
.window-body .mud-expand-panel-content { padding: 4px 8px !important; }
.window-body .mud-expand-panel-text { padding: 0 !important; }

/* MudPaper / MudGrid padding utilities */
.window-body .pa-1 { padding: 2px !important; }
.window-body .pa-2 { padding: 4px !important; }
.window-body .pa-3 { padding: 6px !important; }
.window-body .pa-4 { padding: 8px !important; }
.window-body .mb-1 { margin-bottom: 1px !important; }
.window-body .mb-2 { margin-bottom: 2px !important; }
.window-body .mb-3 { margin-bottom: 4px !important; }
.window-body .mb-4 { margin-bottom: 6px !important; }

/* Buttons */
.window-body .mud-button-root { min-height: 24px !important; padding: 2px 8px !important; }
.window-body .mud-icon-button { padding: 2px !important; }
.window-body .mud-button { font-size: 0.8rem !important; letter-spacing: normal !important; text-transform: none !important; }


/* MudGrid row spacing — only vertical padding, horizontal left untouched to avoid layout issues */
.window-body .mud-grid-item { padding-top: 2px !important; padding-bottom: 2px !important; }

/* MudGrid vertical spacing — paired at 2px; horizontal untouched to avoid overflow */
.window-body .mud-grid { margin-top: -2px !important; margin-bottom: -2px !important; }
.window-body .mud-grid-item { padding-top: 2px !important; padding-bottom: 2px !important; }

/* Stack / flex gaps */
.window-body .mud-stack { gap: 4px !important; }
.window-body .d-flex { gap: 2px !important; }


/* Margin-top utilities */
.window-body .mt-1 { margin-top: 1px !important; }
.window-body .mt-2 { margin-top: 2px !important; }
.window-body .mt-3 { margin-top: 4px !important; }
.window-body .mt-4 { margin-top: 6px !important; }

/* Margin-y utilities */
.window-body .my-1 { margin-top: 1px !important; margin-bottom: 1px !important; }
.window-body .my-2 { margin-top: 2px !important; margin-bottom: 2px !important; }
.window-body .my-3 { margin-top: 4px !important; margin-bottom: 4px !important; }
.window-body .my-4 { margin-top: 6px !important; margin-bottom: 6px !important; }

/* Line height — reduces vertical space occupied by text rows */
.window-body { line-height: 1.2 !important; }
.window-body * { line-height: inherit !important; }

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMj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TUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* Make tooltip wrapper full width without affecting popup */
.full-width-tooltip {
    width: 100% !important;
    display: block !important;
}

/* Ensure the tooltip popup itself has auto width */
.full-width-tooltip .mud-popover {
    width: auto !important;
    max-width: 300px;
}

/* Force ew-resize cursor when hovering over injection marker shapes */
.cvst-shape-hover,
.cvst-shape-hover * {
    cursor: ew-resize !important;
}

.cvst-dragging,
.cvst-dragging * {
    cursor: ew-resize !important;
    user-select: none !important;
}

/* Read-only and disabled unit fields should not look editable. */
.compact-field.field-disabled {
    opacity: 0.65;
}

.compact-field.field-disabled .mud-input-root,
.compact-field.field-readonly .mud-input-root,
.compact-field.mud-disabled .mud-input-root,
.compact-field .mud-input-root.mud-disabled,
.compact-field .mud-input-root:has(input:disabled) {
    background-color: #f5f5f5 !important;
    border-radius: 4px;
}

.compact-field.field-readonly input,
.compact-field.field-readonly .mud-input-slot,
.compact-field.field-disabled input,
.compact-field.field-disabled .mud-input-slot,
.compact-field input[readonly],
.compact-field input:disabled,
.compact-field .mud-input-root[readonly] {
    color: #6b6b6b !important;
}

.compact-field.field-readonly .mud-input-underline:before,
.compact-field .mud-input-underline:has(input[readonly]):before {
    border-bottom-color: #bdbdbd !important;
    border-bottom-style: dashed !important;
}

.compact-field.mud-disabled .mud-input-label,
.compact-field .mud-disabled .mud-input-label {
    color: #9e9e9e !important;
}

/* =============================================================================
   Numeric field sizing (Ref. #8598)

   MudBlazor gives the input element `min-width: 0`, so a unit-aware numeric
   field collapses to whatever width its container hands it and clips the value
   (4440 ft renders as "44"). A readable floor fixes the truncation and restores
   panel-size reflow, because an intrinsic minimum propagates up into the
   containing MudItem / table column:
     - in a MudGrid the row wraps once its columns no longer fit;
     - in a MudTable the column stops shrinking and .mud-table-container scrolls
       horizontally (its overflow-y: auto makes overflow-x compute to auto).
   Viewport breakpoints cannot do this on their own: an MDI window or a narrow
   desktop (Electron) shell is small while the viewport stays large, so xs/sm/md
   never change. The floor is expressed in ch so it follows the WinGLUE-mode
   density override (0.8rem) instead of forcing desktop-sized fields into MDI
   windows.
   ============================================================================= */
:root {
    /* Room for 8 characters, e.g. "12345.67" — well past the 4440 ft in #8598. */
    --wg-numeric-field-min-width: 8ch;
}

.compact-field .mud-input > input.mud-input-root {
    min-width: var(--wg-numeric-field-min-width);
}

/* A label sharing a grid row with its value must wrap inside its own column.
   Flex items default to min-width: auto, so a long label otherwise spills over
   the neighbouring value instead of wrapping. */
.mud-grid-item.d-flex > .mud-typography {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ═══════════════════════════════════════════════════════════════════
   MDI scrollable canvas (SPEC §7.1)
   The canvas is the scrollable desktop that hosts WinGLUE-mode MDI
   windows. Chrome heights come from the manifest via CSS variables set
   by mdi-shell-controller.js (single metrics owner, SPEC §7.1); the
   var() fallbacks only cover the instant before bootstrap.
   ═══════════════════════════════════════════════════════════════════ */
.mdi-canvas {
    position: fixed;
    top: var(--mdi-workspace-top, 96px);
    bottom: var(--mdi-strip-height, 42px);
    left: 0;
    right: 0;
    overflow: auto;
}

/* Invisible sizer that defines the canvas scroll extent. It grows to the
   union of window rectangles so scrollbars appear as needed, and never
   affects window dimensions. */
.mdi-canvas-extent {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    visibility: hidden;
    pointer-events: none;
}
