h1:focus {
    outline: none;
}

/* Embedded routes fit the host's iframe without the portal header/footer spacing. */
.portal-theme.portal-embedded > main > .container {
    max-width: none;
    padding: .75rem max(.75rem, env(safe-area-inset-right)) .75rem max(.75rem, env(safe-area-inset-left));
}

.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;
}

/* Keep the native file input keyboard accessible inside the pencil control. */
.portal-photo-upload {
    position: absolute;
    right: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--bs-body-bg, #fff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    font-size: 14px;
}

.portal-photo-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.portal-theme .portal-photo-upload.btn {
    border-radius: 50% !important;
}

.portal-photo-upload:focus-within {
    outline: 2px solid var(--portal-focus, var(--bs-primary));
    outline-offset: 2px;
}

.booking-step-actions {
    gap: .75rem;
}

.booking-wizard {
    min-width: 0;
    overflow-wrap: anywhere;
}

.booking-progress-mobile {
    display: none;
}

/* Keep phone layouts within the viewport while retaining normal vertical scrolling
   and the horizontal date/category strips. */
@media (max-width: 991.98px) {
    html {
        overflow-x: clip;
        overscroll-behavior-x: none;
        touch-action: pan-x pan-y;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .portal-theme {
        min-height: 100dvh !important;
        overflow-wrap: anywhere;
    }

    .portal-theme :is(.card, .table-responsive, .row > [class*="col-"]) {
        min-width: 0;
    }

    .portal-theme .card > .card-body:not(.p-0) {
        padding: .75rem !important;
    }

    .portal-theme .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    .venue-landing-page .mb-4 {
        margin-bottom: 1rem !important;
    }

    .portal-theme .portal-action-row {
        flex-wrap: wrap;
        gap: .5rem;
        min-width: 0;
        max-width: 100%;
    }

    .portal-theme .portal-action-row > .btn {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        min-height: 2.75rem;
        padding: .5rem .875rem !important;
        font-size: .875rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .portal-theme > main > .container,
    .portal-header > .container,
    .portal-footer > .container {
        padding-left: max(.75rem, env(safe-area-inset-left));
        padding-right: max(.75rem, env(safe-area-inset-right));
    }

    .portal-theme .portal-header .navbar-brand {
        min-width: 0;
        max-width: calc(100% - 4rem);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .portal-theme .portal-header .navbar-collapse {
        background: var(--portal-header-bg);
    }

    .portal-theme .portal-page-heading {
        margin-block: .75rem !important;
    }

    .booking-wizard-grid {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: .75rem;
    }

    .booking-progress .portal-step {
        min-height: 2.5rem;
        padding-inline: .25rem;
    }

    .booking-wizard .booking-step-card > .card-body,
    .booking-wizard .portal-selection > .card-body {
        padding: .75rem !important;
    }

    .booking-wizard :is(.flex-grow-1, .list-group-item > div) {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .booking-wizard :is(h2, h3) {
        font-size: 1rem;
    }

    .booking-wizard section.mb-4 {
        margin-bottom: 1rem !important;
    }

    .booking-wizard .btn {
        min-height: 2.75rem;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Pin each step's own controls so form submission and disabled states stay in sync. */
    .booking-wizard :is(.booking-step-actions, .payment-actions) {
        position: fixed;
        inset: auto 0 0;
        z-index: 990;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: .5rem;
        margin: 0 !important;
        padding: .75rem max(.75rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
        background: var(--portal-mobile-bg, var(--portal-surface));
        color: var(--portal-mobile-text, var(--portal-text));
        border-top: var(--portal-border-width, 1px) solid var(--portal-border);
        box-shadow: var(--portal-shadow);
    }

    .booking-wizard :is(.booking-step-actions, .payment-actions) > .btn {
        min-width: 0;
        width: 100%;
        margin: 0 !important;
        padding: .5rem .875rem !important;
        font-size: .875rem;
        line-height: 1.4;
    }

    .booking-wizard :is(.booking-step-actions, .payment-actions) > .btn:only-child {
        grid-column: 1 / -1;
    }

    .booking-wizard .payment-actions > .btn-primary {
        order: 1;
    }

    /* Leave room for wrapped labels and the device safe area, including at the page footer. */
    .portal-theme.portal-embedded:has(.booking-wizard :is(.booking-step-actions, .payment-actions)) > main {
        padding-bottom: calc(7.5rem + env(safe-area-inset-bottom));
    }

    .portal-theme:has(.booking-wizard :is(.booking-step-actions, .payment-actions)) .portal-footer {
        padding-bottom: calc(7.5rem + env(safe-area-inset-bottom)) !important;
    }

    html:has(.booking-wizard :is(.booking-step-actions, .payment-actions)) {
        scroll-padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
    }

    /* Inputs below 16px cause automatic focus zoom in mobile Safari. */
    .portal-theme :is(.form-control, .form-select) {
        max-width: 100%;
        font-size: max(16px, var(--portal-font-size, 16px));
    }

    .portal-theme .portal-photo-upload.btn {
        width: 44px;
        height: 44px;
    }

    .portal-theme .portal-footer {
        padding-block: 0 !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .portal-footer :is(span, a) {
        min-width: 0;
        max-width: 100%;
    }

    .portal-theme:has(.portal-catalog-toggle) {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
    }

    .portal-theme .portal-catalog-toggle {
        min-height: 2.75rem;
        padding-bottom: calc(.5rem + env(safe-area-inset-bottom));
        white-space: normal;
    }

    .portal-theme:has(.mobile-bottom-booking-bar) {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    .portal-theme .mobile-bottom-booking-bar {
        padding: .75rem max(.75rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left)) !important;
    }

    .mobile-bottom-booking-bar .min-w-0 {
        overflow-wrap: anywhere;
    }

    .mobile-bottom-booking-bar .btn {
        padding-inline: 1rem !important;
    }

    .venue-landing-page {
        padding-top: .75rem !important;
    }
}

/* Nested cards need less spacing on phones than on tablet layouts. Keep button
   heights and the fixed booking controls unchanged so they remain easy to tap. */
@media (max-width: 575.98px) {
    /* Keep small desktop controls easy to tap without enlarging their labels. */
    .portal-theme :is(.btn, .navbar-toggler) {
        min-height: 2.75rem;
    }

    .portal-theme .portal-header .navbar-toggler {
        min-width: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .portal-theme a.btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .booking-wizard .portal-page-heading h1 {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .booking-progress-desktop {
        display: none;
    }

    .booking-progress-mobile {
        display: flex;
        align-items: center;
        gap: .75rem;
        min-width: 0;
        min-height: 1.25rem;
    }

    .booking-progress-caption {
        flex-shrink: 0;
        color: var(--portal-muted, #6c757d);
        font-size: .75rem;
        line-height: 1.4;
    }

    .booking-progress-track {
        display: flex;
        flex: 1;
        gap: .25rem;
        min-width: 0;
    }

    .booking-progress-segment {
        flex: 1;
        height: .3125rem;
        border-radius: 1rem;
        background-color: var(--portal-border, #dee2e6);
    }

    .booking-progress-segment[data-status="completed"] {
        background-color: var(--portal-step-complete-bg, #448c74);
    }

    .booking-progress-segment[data-status="active"] {
        background-color: var(--portal-selection-selected-bg, var(--bs-primary, #448c74));
    }

    .portal-theme > main > .container,
    .portal-header > .container,
    .portal-footer > .container {
        padding-left: max(.5rem, env(safe-area-inset-left));
        padding-right: max(.5rem, env(safe-area-inset-right));
    }

    .portal-theme main .row:not(.g-0, .g-1, .g-2, .gx-0, .gx-1, .gx-2) {
        --bs-gutter-x: .75rem;
    }

    .portal-theme main .row:is(.g-3, .g-4) {
        --bs-gutter-y: .75rem;
    }

    .portal-theme .card > .card-body:not(.p-0) {
        padding: .625rem !important;
    }

    .portal-theme .booking-wizard .booking-step-card > .card-body {
        padding: .5rem !important;
    }

    .portal-theme main .card-header:not(.p-0),
    .booking-wizard .list-group-item {
        padding: .625rem .75rem;
    }

    .portal-theme .portal-page-heading {
        margin-block: .5rem !important;
    }

    .portal-theme main :is(section, .card, fieldset).mb-4,
    .booking-wizard .mb-4,
    .venue-landing-page .mb-4 {
        margin-bottom: .75rem !important;
    }

    .portal-theme main .d-flex.flex-column.gap-3 {
        gap: .75rem !important;
    }

    .portal-theme .card-body.d-flex.gap-3,
    .portal-theme .portal-selection > .card-body > .d-flex.gap-3 {
        gap: .625rem !important;
    }

    .portal-theme main .booking-wizard-grid.row {
        --bs-gutter-y: .5rem;
    }

    .booking-wizard :is(h2, h3).mb-3 {
        margin-bottom: .625rem !important;
    }

    .booking-wizard .booking-next-availability {
        margin-top: .75rem !important;
    }

    .venue-landing-page {
        padding-top: .5rem !important;
    }
}
