html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0964ae;
}

.btn-primary {
    color: #fff;
    background-color: #0964ae;
    border-color: #075089;
}

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

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNT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3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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: #0964ae;
            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");
    }

/* Static intro shown under the loading spinner until Blazor replaces #app (also what crawlers index). */
.app-intro {
    max-width: 640px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem;
    text-align: center;
    color: #6b7280;
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
}
    .app-intro h1 {
        font-size: 1.1rem;
        font-weight: 500;
        color: #03173d;
        margin: 0 0 0.4rem;
    }
    .app-intro p {
        font-size: 0.9rem;
        line-height: 1.45;
        margin: 0;
    }

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

/* ── Notes fields (session notes + per-exercise notes in progress reports) ──
   Plain textareas styled to sit alongside MudBlazor outlined inputs.
   MudBlazor exposes the active institution palette as CSS variables, so these
   follow whatever colours the institution theme selector chooses. */
.av-notes-input,
.av-note-cell {
    width: 100%;
    box-sizing: border-box;
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #212121);
    font-family: inherit;
    border: 1px solid var(--mud-palette-lines-inputs, #c4c4c4);
    resize: vertical;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.av-notes-input {
    padding: 12px 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    border-radius: 8px;
}

.av-note-cell {
    padding: 6px 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 6px;
}

.av-notes-input:hover:not(:disabled),
.av-note-cell:hover:not(:disabled) {
    border-color: var(--mud-palette-action-default, #757575);
}

.av-notes-input:focus,
.av-note-cell:focus {
    border-color: var(--mud-palette-primary, #0527a1);
    box-shadow: 0 0 0 1px var(--mud-palette-primary, #0527a1);
}

.av-notes-input:disabled,
.av-note-cell:disabled {
    opacity: 0.55;
    background: var(--mud-palette-background-grey, #f5f5f5);
}

.av-notes-input::placeholder,
.av-note-cell::placeholder {
    color: var(--mud-palette-text-secondary, #9e9e9e);
    opacity: 0.8;
}

/* ── MudBlazor date-picker: allow the calendar to use its natural width
       even when the input field is narrower (e.g. in toolbar filter rows) */
.mud-picker-popover-paper,
.mud-picker-calendar,
.mud-picker-calendar-container {
    min-width: 310px !important;
    width: auto !important;
}

/* ── Layout CSS (production fallback + dev override-safe) ──────────────── */
/* MainLayout.razor.css compiles to scoped selectors like .page[b-xxx].
   Those override these unscoped rules in dev (higher specificity).
   In production where scoped CSS doesn't apply, these rule as the fallback. */
.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

/* ── Remove all grey divider / border lines from sidebar nav ── */
.sidebar .mud-navmenu,
.sidebar .mud-navmenu::before,
.sidebar .mud-navmenu::after {
    border: none !important;
    box-shadow: none !important;
}

.sidebar .mud-nav-link,
.sidebar .mud-navmenu-item,
.sidebar .mud-nav-item {
    border-bottom: none !important;
    border-top: none !important;
    box-shadow: none !important;
}

.sidebar .mud-nav-link::before,
.sidebar .mud-nav-link::after {
    display: none !important;
}

.sidebar .mud-divider {
    display: none !important;
}

.sidebar .mud-list,
.sidebar .mud-list-item {
    border: none !important;
}

.sidebar .mud-paper {
    border: none !important;
    box-shadow: none !important;
}

.sidebar .mud-nav-group .mud-collapse-wrapper {
    border-top: none !important;
}

/* Remove border below sidebar logo/top-row area */
.sidebar .top-row {
    border-bottom: none !important;
}

/* ── MudCalendar week/day view: fix clipped short-duration events ──────────
   MudCalendar calculates event slot height proportionally to duration.
   A 1-minute event gets ~1-2px height. The .mud-drop-zone wrapper has
   overflow:hidden by default, clipping the event card text to invisible.
   Fix: allow overflow to be visible and enforce a readable minimum height. */
.mud-cal-week-drop-item {
    overflow: visible !important;
    min-height: 22px !important;
}
.mud-cal-week-drop-item > .mud-drop-zone {
    overflow: visible !important;
    min-height: 22px !important;
}
.mud-cal-week-drop-item .mud-drop-item {
    overflow: visible !important;
}
.mud-cal-week-cell-holder {
    overflow: visible !important;
}

/* ── Visible scroll affordance ─────────────────────────────────────────────
   When content overflows, the scrollbar must be PERMANENTLY visible so users
   know more information sits off-screen — overlay scrollbars that auto-hide
   defeat that. Styling ::-webkit-scrollbar switches Chromium/Safari to
   classic, always-rendered scrollbars (they only appear when the container
   actually overflows). scrollbar-width/scrollbar-color must NOT be set in
   Chromium (it would disable the webkit styling and restore auto-hiding
   overlay bars), so it is scoped to Firefox via @supports. */
/* MudBlazor's bundled CSS sets scrollbar-width/scrollbar-color globally; in
   Chromium ANY non-auto value there disables ::-webkit-scrollbar styling and
   restores auto-hiding overlay bars. Reset both so the classic, permanently
   visible scrollbars below take effect. (Firefox then uses its OS default —
   still visible on Windows/Linux.) */
.mud-table-container,
.mud-simple-table,
.mud-dialog-content,
.av-scroll,
[style*="overflow-x:auto"],
[style*="overflow-x: auto"],
[style*="overflow-y:auto"],
[style*="overflow-y: auto"],
[style*="overflow:auto"],
[style*="overflow: auto"] {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
}

.mud-table-container::-webkit-scrollbar,
.mud-simple-table::-webkit-scrollbar,
.mud-dialog-content::-webkit-scrollbar,
.av-scroll::-webkit-scrollbar,
[style*="overflow-x:auto"]::-webkit-scrollbar,
[style*="overflow-x: auto"]::-webkit-scrollbar,
[style*="overflow-y:auto"]::-webkit-scrollbar,
[style*="overflow-y: auto"]::-webkit-scrollbar,
[style*="overflow:auto"]::-webkit-scrollbar,
[style*="overflow: auto"]::-webkit-scrollbar {
    height: 10px;
    width: 10px;
    -webkit-appearance: none;
    background: var(--mud-palette-background-grey, #f0f0f0);
}

.mud-table-container::-webkit-scrollbar-thumb,
.mud-simple-table::-webkit-scrollbar-thumb,
.mud-dialog-content::-webkit-scrollbar-thumb,
.av-scroll::-webkit-scrollbar-thumb,
[style*="overflow-x:auto"]::-webkit-scrollbar-thumb,
[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
[style*="overflow-y:auto"]::-webkit-scrollbar-thumb,
[style*="overflow-y: auto"]::-webkit-scrollbar-thumb,
[style*="overflow:auto"]::-webkit-scrollbar-thumb,
[style*="overflow: auto"]::-webkit-scrollbar-thumb {
    background: var(--mud-palette-grey-default, #9e9e9e);
    border-radius: 5px;
    border: 2px solid var(--mud-palette-background-grey, #f0f0f0);
}

.mud-table-container::-webkit-scrollbar-track,
.mud-simple-table::-webkit-scrollbar-track,
.mud-dialog-content::-webkit-scrollbar-track,
.av-scroll::-webkit-scrollbar-track,
[style*="overflow-x:auto"]::-webkit-scrollbar-track,
[style*="overflow-x: auto"]::-webkit-scrollbar-track,
[style*="overflow-y:auto"]::-webkit-scrollbar-track,
[style*="overflow-y: auto"]::-webkit-scrollbar-track,
[style*="overflow:auto"]::-webkit-scrollbar-track,
[style*="overflow: auto"]::-webkit-scrollbar-track {
    background: var(--mud-palette-background-grey, #f0f0f0);
    border-radius: 5px;
}

/* Dialog action rows with several buttons must wrap on narrow screens
   instead of overflowing off-screen. Covers both real MudDialogActions
   markup and this codebase's bare <MudDialogActions> custom-element
   pattern (dialogs without a <MudDialog> wrapper render it verbatim). */
.mud-dialog-actions > div[style*="display:flex"],
.mud-dialog-actions > div[style*="display: flex"],
muddialogactions > div[style*="display:flex"],
muddialogactions > div[style*="display: flex"] {
    display: flex;
    flex-wrap: wrap;
    row-gap: 8px;
    max-width: 100%;
}
/* The bare custom element itself must not let its row bleed out of the dialog. */
muddialogactions {
    display: block;
    max-width: 100%;
}

/* User notes dialog: Close / Add Note must wrap on phones instead of
   pushing the last button off the edge of the dialog. */
.user-notes-dialog .mud-dialog-actions {
    flex-wrap: wrap;
    row-gap: 8px;
}

/* Message viewer dialog: Reply / Mark / Archive / Sign Off / Close must wrap
   on phones instead of pushing Close off the edge of the dialog. */
.message-view-dialog .mud-dialog-actions {
    flex-wrap: wrap;
    row-gap: 8px;
}

/* Page headers (the title at the top of each routed page, tagged with .page-header) —
   15% smaller than the MudBlazor heading defaults (h3 3rem, h4 2.125rem, h5 1.5rem, h6 1.25rem) */
.mud-typography-h3.page-header { font-size: 2.55rem; }
.mud-typography-h4.page-header { font-size: 1.806rem; }
.mud-typography-h5.page-header { font-size: 1.275rem; }
.mud-typography-h6.page-header { font-size: 1.062rem; }

/* Plain-HTML page headers on Bootstrap-styled pages — same 15% reduction.
   min() mirrors Bootstrap's responsive cap (h1 2.5rem, .display-5 3rem). */
h1.page-header { font-size: calc(min(1.375rem + 1.5vw, 2.5rem) * 0.85); }
h1.display-5.page-header { font-size: calc(min(1.425rem + 2.1vw, 3rem) * 0.85); }
