/* =========================================================
   MODAL HOST CORE
   ========================================================= */

.modal-dialog { display:flex; }

.modal-content.modal-flex{
    display:flex;
    flex-direction:column;
    flex:1 1 auto;
    min-height:0;
    max-height:100%;
}

.modal-header, .modal-footer { flex:0 0 auto; }

.modal-body.modal-body-flex{
    flex:1 1 auto;
    min-height:0;
    overflow:hidden; /* content owns scrolling */
    padding:0;
    display:flex;
    flex-direction:column;
}

/* =========================================================
   GENERIC MODAL SCROLL LAYOUT
   ========================================================= */

.modal-scroll-root{
    height:100%;
    min-height:0;
    display:flex;
    flex-direction:column;
}

.modal-scroll-top{ flex:0 0 auto; }

.modal-scroll-body{
    flex:1 1 auto;
    min-height:0;
    overflow:auto; /* ✅ single scroll container */
}

/* ✅ CRITICAL: the direct child of the scroll container (Virtualize root)
   must stretch so Virtualize has a measurable viewport on first open */
.modal-scroll-body > :first-child{
    min-height:100%;
}

/* =========================================================
   OSX-LIKE SCROLLBAR (best effort)
   ========================================================= */

.modal-scroll-body{
    scrollbar-width:thin;
    scrollbar-color: rgba(0,0,0,.35) transparent;
}
.modal-scroll-body::-webkit-scrollbar{ width:10px; height:10px; }
.modal-scroll-body::-webkit-scrollbar-track{ background:transparent; }
.modal-scroll-body::-webkit-scrollbar-thumb{
    background-color: rgba(0,0,0,.35);
    border-radius:999px;
    border:2px solid transparent;
    background-clip:content-box;
}
.modal-scroll-body::-webkit-scrollbar-thumb:hover{ background-color: rgba(0,0,0,.5); }

/* =========================================================
   SELECTION SHEET
   ========================================================= */
/* Selection sheet layout: top fixed, list scrolls */
/* Root: top fixed, list scrolls */
.ss-root{
    height:100%;
    min-height:0;
    display:flex;
    flex-direction:column;
}

/* Search bar area stays visible */
.ss-top{
    flex:0 0 auto;
    padding: var(--bs-modal-padding, 1rem);
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

/* Only list area scrolls; NO padding so items touch edges */
.ss-list{
    flex:1 1 auto;
    min-height:0;
    overflow:auto;
    background: var(--bs-body-bg);
    padding:0;              /* ✅ no inset spacing */
    margin:0;
}

/* No rounded corners anywhere */
.ss-list-group,
.ss-list-group.list-group{
    border-radius:0 !important;
}

.ss-list-group .list-group-item{
    border-radius:0 !important;  /* ✅ ensures top/bottom items not rounded */
}

/* Dark group header */
.ss-group-header{
    background:#212529;
    color:#fff;
    font-weight:600;
    border-color:#212529;
}

textarea.te-autogrow{
    overflow:hidden;
    resize:none;
    min-height: 4.5rem;
}