/* Table page-size controls only; the original select remains the source of truth. */
.hobi-page-length-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Page-specific table styles can otherwise override Select2's 1px hiding rule. */
body .dataTables_wrapper .dataTables_length select.select2-hidden-accessible,
body .dataTables_wrapper .dt-length select.select2-hidden-accessible,
body .dt-container .dataTables_length select.select2-hidden-accessible,
body .dt-container .dt-length select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 1px !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

body .dataTables_wrapper .dataTables_length label.hobi-page-length-enhanced,
body .dataTables_wrapper .dt-length label.hobi-page-length-enhanced,
body .dt-container .dataTables_length label.hobi-page-length-enhanced,
body .dt-container .dt-length label.hobi-page-length-enhanced {
    justify-content: flex-start;
    gap: 6px;
}

body .dataTables_wrapper .dataTables_length .select2-container,
body .dataTables_wrapper .dt-length .select2-container,
body .dt-container .dataTables_length .select2-container,
body .dt-container .dt-length .select2-container {
    width: 84px !important;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
    text-align: start;
}

.dataTables_length .select2-container--default .select2-selection--single,
.dt-length .select2-container--default .select2-selection--single {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 40px;
    height: 40px;
    border: 1px solid #ced9e8;
    border-radius: 8px;
    background: #fff;
    color: #233957;
}

.dataTables_length .select2-container--default .select2-selection--single .select2-selection__rendered,
.dt-length .select2-container--default .select2-selection--single .select2-selection__rendered {
    display: block;
    width: 100%;
    padding-inline: 10px 24px;
    overflow: hidden;
    color: #233957;
    line-height: 38px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow,
.dt-length .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 6px;
    right: 5px;
    left: auto;
    height: 26px;
}

[dir="rtl"] .dataTables_length .select2-container--default .select2-selection--single .select2-selection__arrow,
[dir="rtl"] .dt-length .select2-container--default .select2-selection--single .select2-selection__arrow {
    right: auto;
    left: 5px;
}

.dataTables_length .select2-container--default.select2-container--focus .select2-selection--single,
.dataTables_length .select2-container--default.select2-container--open .select2-selection--single,
.dt-length .select2-container--default.select2-container--focus .select2-selection--single,
.dt-length .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #6b8def;
    outline: 2px solid rgba(72, 111, 220, .25);
    outline-offset: 1px;
}

.dataTables_length .select2-container--default.select2-container--disabled .select2-selection--single,
.dt-length .select2-container--default.select2-container--disabled .select2-selection--single {
    background: #f1f4f8;
    cursor: not-allowed;
}

.dataTables_length .select2-container--default.select2-container--disabled .select2-selection__rendered,
.dt-length .select2-container--default.select2-container--disabled .select2-selection__rendered { color: #7a8899; }

.select2-dropdown.hobi-page-length-dropdown {
    box-sizing: border-box;
    max-width: calc(100vw - 16px);
    overflow: hidden;
    border: 1px solid #d4deec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(26, 49, 90, .16);
}

.hobi-page-length-dropdown .select2-results > .select2-results__options {
    max-height: min(320px, 45vh);
    padding: 4px;
    overflow-y: auto;
}

body .select2-container--default .hobi-page-length-dropdown .select2-results__option {
    min-height: 36px;
    padding: 7px 5px;
    border-radius: 5px;
    color: #253a58;
    font-size: 13px;
    line-height: 20px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.select2-container--default .hobi-page-length-dropdown .select2-results__option[aria-selected="true"] { background: #eef3fc; }
.select2-container--default .hobi-page-length-dropdown .select2-results__option--highlighted[aria-selected] { background: #315fe6; color: #fff; }
