/* DB-P5-ASSET-FILTER-FIX-04: filter interaction surfaces only. */

.filter-bar .filter-row {
  position: relative;
  overflow: visible;
  white-space: nowrap;
}

/* Keep the top line to the three intended entry points. The existing type and
   domain controls remain mounted in More, so their data semantics and handlers
   stay shared rather than being duplicated. */
.filter-bar .identity-filter-group {
  display: none;
}

.filter-bar .more-filter-responsive {
  display: grid;
}

.role-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 88px;
  max-width: min(260px, 30vw);
  min-height: 29px;
  padding: 0 10px !important;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #737e91;
  font: inherit;
  font-size: 11px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-filter-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-filter-trigger > i {
  flex: 0 0 auto;
  color: #a0a8b4;
  font-style: normal;
  font-size: 12px;
}

.role-filter-trigger:hover,
.role-filter-trigger.active,
.role-filter-trigger.is-open {
  background: rgba(255, 255, 255, .58);
  color: #455167;
}

.role-filter-menu {
  position: absolute;
  z-index: 160;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, calc(100vw - 28px));
  max-height: min(480px, calc(100vh - 150px));
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(109, 128, 157, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 12px 28px rgba(44, 59, 86, .14), 0 2px 7px rgba(44, 59, 86, .07);
  pointer-events: auto;
}

.role-filter-section + .role-filter-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(88, 106, 138, .10);
}

.role-filter-section > span,
.role-category-section > header > span {
  color: #8b96a7;
  font-size: 9px;
  font-weight: 560;
}

.role-filter-options,
.role-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.role-filter-options button,
.role-category-option,
.role-category-trail button,
.role-category-section header button {
  min-height: 29px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: rgba(229, 234, 243, .55);
  color: #657184;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.role-filter-options button:hover,
.role-filter-options button:focus-visible,
.role-category-option:hover,
.role-category-option:focus-visible,
.role-category-trail button:hover,
.role-category-section header button:hover {
  outline: none;
  background: rgba(226, 235, 248, .82);
  color: #405777;
}

.role-filter-options button.selected,
.role-category-option.selected {
  background: rgba(218, 230, 247, .82);
  color: #405777;
  font-weight: 600;
}

.role-category-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.role-category-section > header button {
  min-height: 22px;
  padding-inline: 6px;
  background: transparent;
  color: #7186a7;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.role-category-option {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 92px;
}

.role-category-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-category-option span small {
  color: #9aa7b7;
  font-size: 9px;
}

.role-category-option i {
  color: #8194b3;
  font-style: normal;
}

.role-category-trail {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 6px;
}

.role-category-trail span {
  min-width: 0;
  overflow: hidden;
  color: #71809a;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-category-trail button {
  flex: 0 0 auto;
  min-height: 22px;
  padding-inline: 6px;
  background: transparent;
  color: #7186a7;
}

.role-category-empty {
  display: block;
  margin-top: 6px;
  color: #9aa4b2;
  font-size: 10px;
}

.filter-bar .asset-color-popover,
.filter-bar .facet-filter-popover,
.filter-bar .filter-popover-menu {
  z-index: 160;
  pointer-events: auto;
}

/* The menu is a child of the role trigger container; never clip its surface. */
@media (max-width: 640px) {
  .filter-bar .filter-row {
    overflow: visible;
  }

  .role-filter-trigger {
    max-width: min(220px, 48vw);
  }

  .role-filter-menu {
    width: min(300px, calc(100vw - 24px));
  }
}
