/* Shared PABX / Connect search-form alignment.
   Load last. Only direct, two-cell layout tables are changed; data tables,
   login forms, field values, plugin visibility and button groups are untouched. */

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body {
  box-sizing: border-box;
  min-width: 0;
}

/* A two-cell row identifies the legacy form layout. Exclude every known
   result-table class and nested tables rather than flattening arbitrary data. */
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > table:not(.table):not(.table-content):not(.boo-table):not(.dataTable):not(.datatable):not(.data-table):not([role="grid"]):not(:has(table)):not(.hide):not(.hidden):not([hidden]):not([style*="display:none"]):not([style*="display: none"]):has(> tbody > tr > td:first-child:nth-last-child(2)) {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > table:not(.table):not(.table-content):not(.boo-table):not(.dataTable):not(.datatable):not(.data-table):not([role="grid"]):not(:has(table)):has(> tbody > tr > td:first-child:nth-last-child(2)) > tbody:not(.hide):not(.hidden):not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > table:not(.table):not(.table-content):not(.boo-table):not(.dataTable):not(.datatable):not(.data-table):not([role="grid"]):not(:has(table)) > tbody > tr:has(> td:first-child:nth-last-child(2)):not(.hide):not(.hidden):not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 12px;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > table:not(.table):not(.table-content):not(.boo-table):not(.dataTable):not(.datatable):not(.data-table):not([role="grid"]):not(:has(table)) > tbody > tr:has(> td:first-child:nth-last-child(2)) > td:not(.hide):not(.hidden):not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
  display: block !important;
  float: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
  vertical-align: top;
}

/* The separate reseller/customer selector shares the same usable width. */
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > .controls,
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > .control-group > .controls {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body label {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* No display override is applied to selects or their generated containers.
   Select2's original offscreen select and Bootstrap Select stay hidden. */
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body :is(.select2-container, .bootstrap-select) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body :is(input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], textarea):not(.select2-input):not(.select2-search__field):not(.select2-offscreen):not(.select2-hidden-accessible) {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .clear-icon-wrap:not(.hide):not(.hidden):not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
  display: block !important;
  position: relative;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .clear-icon-wrap > input:not([type="hidden"]) {
  width: 100% !important;
  max-width: 100% !important;
  padding-right: 56px !important;
  box-sizing: border-box !important;
}

/* Preserve the plugin's fadeIn/fadeOut display and the existing click handler. */
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .clear-icon-wrap > .clear-icon-btn {
  position: absolute !important;
  right: 8px !important;
  left: auto !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
}

@media (max-width: 640px) {
  :is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body > table:not(.table):not(.table-content):not(.boo-table):not(.dataTable):not(.datatable):not(.data-table):not([role="grid"]):not(:has(table)) > tbody > tr:has(> td:first-child:nth-last-child(2)):not(.hide):not(.hidden):not([hidden]) {
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
    row-gap: 12px;
  }
}

/* A consistent control height across the original input and Select2 widgets. */
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .clear-icon-wrap > input:not([type="hidden"]),
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .select2-container > .select2-choice,
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body [data-toggle="buttons-radio"] > .btn {
  box-sizing: border-box !important;
  min-height: 36px !important;
  height: 36px !important;
}
:is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .select2-container > .select2-choice {
  line-height: 34px !important;
}
@media (max-width: 640px) {
  :is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .clear-icon-wrap > input:not([type="hidden"]),
  :is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .select2-container > .select2-choice,
  :is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body [data-toggle="buttons-radio"] > .btn {
    min-height: 44px !important;
    height: 44px !important;
  }
  :is(html[data-vyxcore-theme], html[data-next-router-theme]):not([data-vixcore-login]):not([data-next-router-login]) body .frm-search .widget-body .select2-container > .select2-choice {
    line-height: 42px !important;
  }
}
