/* ============================================================
   PROFESSIONALS MARKETPLACE
   Developers, engineers, architects & surveyors.
   Built on the 9jaRealty palette already in style.css:
   --primary #008751, --accent #D4AF37, --dark #121824
   ============================================================ */

.pro-section {
    --pro-border: #e2e8f0;
    --pro-muted: #64748b;
    --pro-surface: #ffffff;
    --pro-bg: #f8fafc;
}

/* ---------- masthead ---------- */
.pro-masthead {
    background:
        radial-gradient(1200px 320px at 12% -40%, rgba(0, 135, 81, 0.35), transparent 70%),
        linear-gradient(100deg, #0b1220 0%, #121824 55%, #0d2a20 100%);
    color: #fff;
    padding: 34px 0 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pro-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #D4AF37;
    margin-bottom: 6px;
}

.pro-masthead-title {
    font-size: clamp(1.55rem, 3.2vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0 0 8px;
    line-height: 1.15;
}

.pro-masthead-sub {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.94rem;
    line-height: 1.55;
    max-width: 54ch;
}

/* ---------- sticky toolbar ---------- */
.pro-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
}

.pro-toolbar-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pro-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 0;
}

.pro-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.pro-search input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 34px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.9rem;
    background: #fff;
    color: #0f172a;
}

.pro-select {
    height: 40px;
    padding: 0 30px 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.86rem;
    background-color: #fff;
    color: #0f172a;
    /* Sized so search + five filters + Apply fit one row on a laptop; the
       mobile rule below overrides this to a two-up wrapping grid. */
    flex: 0 1 166px;
    min-width: 0;
    max-width: 100%;
}

select.pro-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 14px;
}

.pro-search input:focus,
.pro-select:focus {
    outline: none;
    border-color: #008751;
    box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.14);
}

/* The selects sit inline in the toolbar flex row on desktop; `display: contents`
   means the wrapper adds no box of its own. On mobile it becomes a real, wrapping
   row that the toggle shows and hides. */
.pro-filter-fields { display: contents; }

.pro-filter-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    font-size: 0.86rem;
    font-weight: 600;
}

.pro-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #008751;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ---------- result bar ---------- */
.pro-result-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pro-result-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.pro-active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.pro-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.pro-filter-pill i {
    font-size: 0.62rem;
    opacity: 0.7;
}

.pro-filter-pill:hover {
    background: #d1fae5;
    color: #065f46;
}

.pro-clear-all {
    font-size: 0.78rem;
    color: #64748b;
    text-decoration: underline;
}

/* ---------- chips ---------- */
.pro-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.pro-chip:hover {
    border-color: #94a3b8;
    color: #0f172a;
}

.pro-chip.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.pro-chip-scroller {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* ---------- the grid ----------
   Narrower columns than the first pass: four across a laptop rather than three,
   so a card reads as a card and not as a banner. */
.pro-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
}

/* ---------- professional card ---------- */
.pro-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pro-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.pro-card:focus-within {
    border-color: #008751;
    box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.14);
}

.pro-card.is-featured { border-color: #fcd34d; }

/* Cover: the uploaded banner, or a gradient the model picks from the slug. */
.pro-card-cover {
    position: relative;
    height: 110px;
    flex-shrink: 0;
    background: linear-gradient(120deg, #0d3a29, #008751);
}

.pro-card-cover::after {
    /* Keeps the status dot and tag legible over a busy photograph */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 60%);
}

.pro-card-cover .pro-dot-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.pro-cover-tag {
    position: absolute;
    top: 9px;
    left: 10px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #b45309;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pro-card-body {
    padding: 0 14px 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.pro-dot-status {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.pro-dot-status.is-available { background: #22c55e; }
.pro-dot-status.is-limited   { background: #f59e0b; }
.pro-dot-status.is-booked    { background: #94a3b8; }

.pro-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    /* Portraits put the face in the upper part of the frame; centring the crop
       on the middle cut heads off in the small square. */
    object-position: center 30%;
    background: linear-gradient(135deg, #0d3a29, #008751);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Profile page: big enough to recognise the person (uploads keep 800px, so
   this stays sharp on high-density screens). */
.pro-avatar-lg {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    font-size: 3rem;
    border: 5px solid #fff;
    margin-top: -100px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.pro-avatar-sm {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 0.85rem;
}

/* Profile picture, overlapping the cover. At 54px nobody could be recognised;
   96px shows a face clearly while still leaving room for the card details. */
.pro-avatar-card {
    width: 124px;
    height: 124px;
    border-radius: 50%;
    font-size: 2rem;
    border: 4px solid #fff;
    margin-top: -62px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    position: relative;
    z-index: 1;
}

.pro-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    line-height: 1.25;
    min-width: 0;
}

.pro-name {
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.94rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-card:hover .pro-name { color: #008751; }

.pro-verified {
    color: #008751;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pro-role {
    color: #008751;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pro-meta-line {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 3px;
    min-width: 0;
}

.pro-dot { opacity: 0.5; }

.pro-meta {
    color: #64748b;
    font-size: 0.85rem;
}

.pro-headline {
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 9px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pro-card-foot {
    display: flex;
    align-items: stretch;
    margin-top: auto;
    padding-top: 10px;
}

.pro-figure {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.pro-figure + .pro-figure { border-left: 1px solid #f1f5f9; }

.pro-figure-value {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.pro-figure-label {
    display: block;
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 1px;
}

/* ---------- empty state ---------- */
.pro-empty {
    text-align: center;
    padding: 52px 20px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.pro-empty i { font-size: 2.4rem; color: #cbd5e1; }
.pro-empty h3 { font-size: 1.05rem; font-weight: 700; margin: 14px 0 6px; }
.pro-empty p { color: #64748b; font-size: 0.9rem; margin-bottom: 16px; }

/* ---------- join strip ---------- */
.pro-join-strip {
    margin-top: 28px;
    padding: 20px 22px;
    border-radius: 14px;
    background: linear-gradient(100deg, #0b1220, #123a2a);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.pro-join-strip h2 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.pro-join-strip p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
    max-width: 62ch;
}

.pro-join-strip > div { flex: 1 1 320px; min-width: 0; }

/* ---------- badges ---------- */
.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.pro-badge-verified {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.pro-badge-featured {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.pro-badge-available {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.pro-badge-limited {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.pro-badge-booked {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* ---------- stars ---------- */
.pro-stars {
    color: #D4AF37;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.pro-stars .bi {
    line-height: 1;
}

/* ---------- portfolio grid ---------- */
.pro-job-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.pro-job-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.pro-job-thumb {
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    background: #e2e8f0;
    display: block;
}

.pro-job-thumb-empty {
    aspect-ratio: 16 / 10;
    background: linear-gradient(120deg, #e2e8f0, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2rem;
}

.pro-job-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.pro-job-title {
    font-weight: 700;
    color: #121824;
    font-size: 1rem;
    text-decoration: none;
    line-height: 1.35;
}

.pro-job-title:hover {
    color: #008751;
}

/* ---------- review ---------- */
.pro-review {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.pro-review-response {
    background: #f8fafc;
    border-left: 3px solid #008751;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: #475569;
}

/* ---------- star picker ---------- */
.star-picker {
    display: inline-flex;
    gap: 6px;
    font-size: 2rem;
    cursor: pointer;
}

.star-picker .bi {
    color: #cbd5e1;
    transition: color 0.12s ease, transform 0.12s ease;
}

.star-picker .bi.is-on {
    color: #D4AF37;
}

.star-picker .bi:hover {
    transform: scale(1.12);
}

/* ============================================================
   CHAT WORKSTATION
   Three panes on desktop; below 992px it becomes a two-screen
   list -> thread flow driven by .mobile-chat-open.
   ============================================================ */

.chat-workstation {
    display: flex;
    gap: 16px;
    height: calc(100vh - 190px);
    min-height: 560px;
}

.chat-pane {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversations-pane {
    width: 320px;
    flex-shrink: 0;
}

/* min-width:0 is required here, or a long unbroken word blows the layout out */
.chat-middle-pane {
    flex: 1 1 auto;
    min-width: 0;
}

.details-pane {
    width: 300px;
    flex-shrink: 0;
}

.chat-pane-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.conversations-scroll,
.details-scroll {
    overflow-y: auto;
    flex: 1 1 auto;
}

.conv-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s ease;
}

.conv-item:hover {
    background: #f8fafc;
}

.conv-item.active {
    background: #f0fdf4;
    border-left-color: #008751;
}

.conv-item-body {
    min-width: 0;
    flex: 1 1 auto;
}

.conv-item-name {
    font-weight: 700;
    color: #121824;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-item-preview {
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-stream-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 16px;
    background: #fafafc;
}

.chat-bubble {
    max-width: 82%;
    border-radius: 16px;
    padding: 10px 15px;
    margin-bottom: 12px;
    word-break: break-word;
    font-size: 0.92rem;
    line-height: 1.5;
}

.chat-bubble.mine {
    background: #008751;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
    background: #fff;
    color: #121824;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-bubble .bubble-name {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 3px;
    opacity: 0.85;
}

.chat-bubble .bubble-time {
    font-size: 0.68rem;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

/* System lines record the booking transitions inside the thread itself */
.chat-system-line {
    text-align: center;
    margin: 14px auto;
    max-width: 92%;
}

.chat-system-line span {
    display: inline-block;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.chat-composer {
    border-top: 1px solid #e2e8f0;
    padding: 12px 14px;
    flex-shrink: 0;
    background: #fff;
}

/* ---------- the inline booking bar ----------
   The details pane disappears below 1200px, so the primary booking action is
   mirrored into a compact strip pinned above the composer - where the user is
   already looking. It MUST live outside the composer <form>: nesting forms is
   invalid HTML and the buttons silently submit the composer instead. */
.booking-inline-bar {
    display: none;
    border-top: 1px solid #e2e8f0;
    padding: 10px 14px;
    flex-shrink: 0;
}

.booking-inline-bar:not(:empty) {
    display: block;
}

.booking-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.booking-strip .strip-text {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.35;
}

.booking-strip .btn {
    flex-shrink: 0;
}

.booking-strip.state-none {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.booking-strip.state-awaiting {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.booking-strip.state-confirmed {
    background: #f0fdf7;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.sidebar-detail-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.sidebar-detail-card h6 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    padding: 4px 0;
}

.detail-row .label {
    color: #64748b;
    flex-shrink: 0;
}

.detail-row .value {
    color: #121824;
    font-weight: 600;
    text-align: right;
    min-width: 0;
    word-break: break-word;
}

.chat-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    padding: 30px;
    text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 1199.98px) {
    /* Pane 3 becomes an offcanvas drawer reached from the chat header */
    .details-pane {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .chat-workstation {
        height: calc(100vh - 160px);
        min-height: 480px;
        gap: 0;
    }

    .conversations-pane {
        width: 100%;
    }

    .chat-middle-pane {
        display: none;
        width: 100%;
    }

    .mobile-chat-open .conversations-pane {
        display: none;
    }

    .mobile-chat-open .chat-middle-pane {
        display: flex;
    }

    .chat-bubble {
        max-width: 90%;
    }
}

@media (max-width: 767.98px) {
    .pro-masthead {
        padding: 24px 0 22px;
    }

    /* One card per row, so the card head never crushes */
    .pro-grid {
        grid-template-columns: 1fr;
    }

    /* Collapse the five selects behind the toggle: expanded they would make a
       230px sticky block, which is a third of a phone screen. */
    .pro-filter-toggle { display: inline-flex; }

    .pro-filter-fields {
        display: none;
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 2px;
    }

    .pro-filter-fields.is-open { display: flex; }

    .pro-select {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    .pro-search { flex: 1 1 100%; }

    /* Search on its own row, then [Filters] [Apply] side by side */
    .pro-filter-toggle,
    .pro-apply { flex: 1 1 calc(50% - 4px); justify-content: center; }
}

@media (max-width: 575.98px) {
    .pro-avatar-lg {
        width: 160px;
        height: 160px;
        border-radius: 50%;
        font-size: 2.4rem;
        margin-top: -80px;
    }

    .star-picker {
        font-size: 1.7rem;
    }

    /* The rate string is the first thing to overflow a 375px card */
    .pro-figure-rate .pro-figure-value {
        font-size: 0.78rem;
    }
}

/* ── Scrollable modals whose content is wrapped in a form ─────────────────
 *
 * Bootstrap's .modal-dialog-scrollable makes .modal-content a flex column and
 * expects .modal-header / .modal-body / .modal-footer to be its DIRECT
 * children. Our forms wrap all three - which is the natural way to write a
 * Django form - so the only flex child is the <form>, the body never gets a
 * bounded height, and it grows past the bottom of the screen instead of
 * scrolling. On a phone that put the submit button out of reach: the enquiry
 * form could be read but never sent.
 *
 * Making the form the flex column instead restores exactly what Bootstrap
 * intended. min-height: 0 is the essential part - without it a flex item
 * refuses to shrink below its content, whatever its flex-shrink says.
 */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
    overflow-y: auto;
    min-height: 0;
}

/* The header and footer stay put while the body moves under them. */
.modal-dialog-scrollable .modal-content > form > .modal-header,
.modal-dialog-scrollable .modal-content > form > .modal-footer {
    flex-shrink: 0;
}
