html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
html, body, #app, .page {
    height: 100dvh !important;
    overflow: hidden !important;
    margin: 0;
    padding: 0;
}
.selected-row {
    background-color: var(--mud-palette-action-selected) !important;
    font-weight: bold;
}
.notelist-row {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.mud-icon-menu {
    margin-right: 10px !important;
}
.button-spacing .mud-icon-button {
    margin: 6px;
}

a, .btn-link {
    color: var(--mud-palette-primary);
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--mud-palette-surface), 0 0 0 0.25rem var(--mud-palette-primary);
}

.diagram-canvas {
    width: 100%;
    height: 100%;
    background-color: #f4f4f4; /* Helps see the bounds while testing */
}

.content {
    padding-top: 5px;
}

h1:focus {
    outline: none;
}

.mud-switch-thumb-medium {
    margin-top: -6px !important;
    margin-left: -6px !important;
}

/* 1. Define a consistent transition for ALL states to prevent "snapping" */
.mud-collapse-wrapper {
    /* Use a shorter duration so it finishes before the 0.5s height transition ends */
   
}

/* 2. Hidden state: Only during the 'entering' phase */
.mud-collapse-entering .mud-collapse-wrapper {
    opacity: 0 !important;
}

/* 3. Opening state: Give it a slight delay so it starts halfway through the expand */
.mud-collapse-entering .mud-collapse-wrapper {
    transition-delay: 0.15s !important;
    opacity: 0 !important;
}

/* 4. Final state: Must remain smooth so it doesn't 'pop' when class changes */
.mud-collapse-entered .mud-collapse-wrapper {
    opacity: 1 !important;
    
}

/* 5. Closing state: Fade out immediately (no delay) */
.mud-collapse-exiting .mud-collapse-wrapper {
    opacity: 0 !important;
    transition: opacity 0.15s ease-in-out 0s !important;
}


.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mud-palette-success);
}

.invalid {
    outline: 1px solid var(--mud-palette-error);
}

.validation-message {
    color: var(--mud-palette-error);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIG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NzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--mud-palette-error-darken);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--mud-palette-error-text);
}

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

.darker-border-checkbox.form-check-input {
    border-color: var(--mud-palette-lines-inputs);
}

/* for mudgrid selection in ManageRights*/
.custom-selected {
    background-color: var(--mud-palette-action-selected) !important;
}

.grid-title {
    font-weight: 500;
    font-size: 14px;
}


/*html, body, #app, .mud-layout {
    height: 100dvh !important;
    overflow: hidden !important;
    margin: 0;
}*/

/* The container JS is targeting */
#editor-container {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* The container shouldn't scroll, the editor should */
}

note-display-content, .note-preview {
    /* Ensures the content flows like plain text and doesn't have unexpected spacing */
    margin: 0 !important;
    padding: 0 !important;
    display: inline; /* Forces everything to flow like plain text */
    line-height: 1.2 !important;
    text-align: left !important;    
}
.note-preview {
    max-height: 60px;
    overflow-y: hidden;
}
.note-display-content p {
   line-height: 1 !important;
   margin-bottom: 0 !important;

}
/* Target Tiptap's internal class */
.ProseMirror {
    flex-grow: 1;
    overflow-y: auto; /* This gives you the internal scrollbar */
    padding: 1rem;
    outline: none;
}

/* Ensure the editor wrapper fills the JS-sized container */
/*.tiptap-editor-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}*/

.scroll-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--mud-palette-surface); /* Prevent content from showing through while shifting */
    transition: transform 0.1s ease-out; /* Smooths out the keyboard "jump" */
    display: flex;
    flex-wrap: nowrap; /* Keep them in a single line */
    overflow-x: auto; /* Enable horizontal scrolling */
    width: 100% !important; /* Ensure it fills the constrained parent */
    min-width: auto;
    flex-shrink: 0; /* Prevents the vertical layout from squashing it */
    scrollbar-width: auto;
    scrollbar-color: var(--mud-palette-text-secondary) var(--mud-palette-background-grey);
    padding-bottom: 2px;
    margin: 2px 0 4px 0;
}

    /* Force specific height for horizontal scrollbars */
    .scroll-container::-webkit-scrollbar {
        height: 16px !important; /* Increase this number to make it thicker */
        display: block !important;
    }

    .scroll-container::-webkit-scrollbar-thumb {
        background-color: var(--mud-palette-text-secondary);
        border-radius: 8px;
        border: 3px solid var(--mud-palette-background-grey); /* Adding a border makes the 'track' look wider */
    }

    .scroll-container::-webkit-scrollbar-track {
        background: var(--mud-palette-background-grey);
    }

.parent-scroll-container {
    display: flex; /* If this is a flex item in your layout */
    min-width: 0 !important; /* CRITICAL: Allows the parent to be smaller than its children */
    width: 100% !important; /* Forces it to stay within the screen boundaries */
    overflow: hidden; /* Fallback to prevent content from pushing width */
}

.mud-main-content, .mud-container, article, .main, .note-tools {
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
}
/* The wrapper fills exactly the space provided by @Body in MainLayout */
.subpage-container {
    display: flex;
    flex-direction: column;
    /* Ensure it doesn't exceed the parent's height */
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.subpage-toolbar {
    flex-shrink: 0; /* Prevents toolbar from squashing */
    z-index: 10;
    padding: 4px;
    /* position: sticky is safer than 'fixed' here */
    position: sticky;
    top: 0;
}

.subpage-body {
    flex-grow: 1;
    min-height: 0; /* Essential for flexbox scrolling */
    overflow-y: auto;
    padding: 15px 0;
}



