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

a, .btn-link {
    color: #006bb7;
}

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

h1:focus {
    outline: none;
}

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

.mud-required-text {
    color: #EF4444 !important;
}

.nav-section-label {
    padding: 16px 16px 4px 16px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--mud-palette-text-disabled);
    text-transform: uppercase;
    user-select: none;
}

/* The growing text column of a row — an address, a name — with chips or a menu beside
   it. It must be allowed to shrink below its content (min-width:0) or the row overflows;
   but shrinking is all it did on a phone, where an address came out one word per line
   while the chips beside it kept their full width. The phone rule below gives it the
   whole row instead. Declared here rather than inline because a style attribute outranks
   a media query, which is why the first attempt at this changed nothing. */
.row-main {
    flex: 1;
    min-width: 0;
}

/* ─── Phones ────────────────────────────────────────────────────────────────
   MudStack Row renders as .d-flex.flex-row (there is no .mud-stack class) with
   flex-wrap:nowrap, so on a narrow screen a row either squeezed its children or ran
   off the edge — filter chip rows were clipped mid-word. Allowing the wrap is a
   no-op wherever the row already fits, so nothing changes above this width.

   It is also what lets a page header work: a title beside an action button is one of
   these rows, and the wrap drops the button onto its own line rather than crushing the
   heading. */
@media (max-width: 599.98px) {
    .d-flex.flex-row {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    /* A dialog at ExtraSmall/Small still reserves desktop margins, which on a 390px
       screen leaves the form itself barely wider than its own labels. */
    .mud-dialog {
        margin: 12px;
        width: calc(100% - 24px);
        max-width: calc(100% - 24px);
    }

    /* Tables that opt out of the stacked layout must scroll on their own rather
       than pushing the page sideways. */
    .mud-table-container {
        overflow-x: auto;
    }

    /* The display sizes are set for a page that is 1200px wide. At 390px, h4 — which
       every page title uses — took three lines for "Welcome back, <name>" before the
       content started. The scale is reduced, not the hierarchy: each step is still
       clearly larger than the one below it. */
    .mud-typography-h3 { font-size: 1.75rem; line-height: 1.2; }
    .mud-typography-h4 { font-size: 1.45rem; line-height: 1.25; }
    .mud-typography-h5 { font-size: 1.2rem;  line-height: 1.3; }
    .mud-typography-h6 { font-size: 1.05rem; line-height: 1.35; }

    /* See .row-main above: on a phone it takes the whole row, so the controls that sat
       beside it wrap underneath rather than squeezing it. */
    .row-main { flex: 1 0 100%; }

    /* Anchored to the bell at the right edge, so a fixed 360px hung off a 390px screen
       with its own scrollbar out of reach. */
    .mud-popover { max-width: calc(100vw - 16px); }

    /* iOS zooms the page in when a field smaller than 16px takes focus, and never zooms
       back out. The root is 15px to match Easybook, which put every input just under the
       threshold — so typing an address moved the whole form off-screen. Only the fields
       are pinned back to 16px; the rest of the scale stays as designed. */
    .mud-input-root,
    .mud-input-slot,
    .mud-input input,
    .mud-input textarea,
    .mud-select-input input {
        font-size: 16px;
    }

    /* A finger is not a pointer. MudBlazor's buttons are 36px at a 16px root, and the
       15px root taken from Easybook put every one of them at 35px — under the 44px both
       Apple and Material ask for. Raised to 44 on phones only, so desktop density is
       untouched; the width floor is for the icon buttons, which are square. */
    .mud-button-root,
    .mud-icon-button {
        min-height: 44px;
    }

    .mud-icon-button {
        min-width: 44px;
    }

    /* Except where a control sits inside another one — a date picker's own arrows, a
       numeric field's spinner — where 44px would stretch the field around it. */
    .mud-input-adornment .mud-icon-button,
    .mud-picker .mud-icon-button,
    .mud-numeric-input .mud-icon-button {
        min-height: 0;
        min-width: 0;
    }
}

/* MudFileUpload renders a chip for each chosen file. Where a picker lists the files itself —
   with their type, size and a way to remove them — the chip says the same thing again in a
   different shape, so every attachment appeared twice. The list is the fuller of the two. */
[data-picker] .mud-chip {
    display: none;
}

/* A listing card lifts under the pointer, so a row of them reads as a row of things to open
   rather than a table somebody forgot to draw lines on. */
.listing-card {
    transition: box-shadow .15s ease, transform .15s ease;
}

.listing-card:hover {
    box-shadow: 0 6px 20px rgba(15, 43, 93, .14);
    transform: translateY(-2px);
}

/* Filters lead on a phone, where a rail beside the results has nowhere to sit; beside them
   from tablet up. Ordered rather than repeated, so there is one of each control. */
.filters-rail { order: -1; }

@media (min-width: 960px) {
    .filters-rail { order: 0; }
}

/* ─── Easybook's shape ──────────────────────────────────────────────────────
   The palette lives in AppTheme.cs, where MudBlazor can read it. These two are
   things a MudTheme has no field for: the card shadow and the root type size.
   Both are Easybook's own values, so a card here and a card there cast the same
   shadow and sit at the same scale. */

/* 15px rather than the browser's 16px, the same as Easybook. Nearly everything is
   sized in rem, so moving the root moves type, padding and control heights together
   instead of shrinking text inside boxes that did not move. Set on html, because rem
   resolves against the root element. */
html {
    font-size: 15px;
}

/* --eb-card-shadow. MudBlazor's elevation 1–3 is a grey drop shadow; Easybook's is a
   soft blue one, which is most of why its cards look lighter. Only the low elevations
   are replaced — menus and dialogs at higher elevations still need to lift off the
   page. */
.mud-elevation-1 {
    box-shadow: 0 1px 2px rgba(16, 42, 84, 0.04), 0 6px 20px rgba(16, 42, 84, 0.06) !important;
}

.mud-elevation-2 {
    box-shadow: 0 1px 2px rgba(16, 42, 84, 0.04), 0 6px 20px rgba(16, 42, 84, 0.06) !important;
}

.mud-elevation-3 {
    box-shadow: 0 2px 4px rgba(16, 42, 84, 0.06), 0 10px 28px rgba(16, 42, 84, 0.10) !important;
}

/* The top bar is white now, so it needs the hairline Easybook's has to separate it
   from the page behind it. */
.mud-appbar {
    border-bottom: 1px solid var(--mud-palette-divider);
}
