/* DB-P5-ASSET-FILTER-FIX-05: restore four direct dimensions and repair color panel. */

.filter-bar {
  container-type: inline-size;
}

.filter-bar .identity-filter-group {
  display: flex !important;
  align-items: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}

.filter-bar .identity-filter-group .filter-popover {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
}

.filter-bar .more-filter-responsive {
  display: none !important;
}

.filter-bar .filter-popover-trigger {
  max-width: 156px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-bar .identity-filter-group .filter-popover-trigger {
  min-width: 74px;
  padding-inline: 8px;
}

.filter-bar .filter-row .filter-popover-menu {
  top: calc(100% + 7px);
  left: 0;
}

/* The prior panel relied on a native color input styled as a ring. Safari can
   render that as an external native picker and the panel then loses its
   compact controls. Use a real in-panel hue wheel instead. */
.filter-bar .asset-color-popover {
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  z-index: 180;
  width: min(296px, calc(100vw - 24px));
  max-width: calc(100cqw - 24px);
  box-sizing: border-box;
}

.asset-color-wheel-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.asset-color-wheel-label {
  justify-items: center;
}

.asset-color-wheel {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  box-shadow: 0 2px 8px rgba(45, 66, 104, .14), inset 0 0 0 1px rgba(255, 255, 255, .7);
  cursor: crosshair;
  touch-action: none;
}

.asset-color-wheel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--selected-color, #6f85b7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.asset-color-wheel-marker {
  position: absolute;
  z-index: 1;
  top: 2px;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 1px 4px rgba(31, 43, 64, .32);
  transform: translate(-50%, 0) rotate(var(--hue-angle, 0deg)) translateY(-1px);
  transform-origin: 50% 32px;
  pointer-events: none;
}

.asset-color-wheel:focus-visible {
  outline: 2px solid rgba(82, 111, 170, .52);
  outline-offset: 3px;
}

.asset-color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 19px);
  justify-content: start;
  max-width: none;
}

.asset-color-hex input {
  width: 104px;
}

.asset-color-adjust input[type="range"] {
  width: 168px;
}

@container db-filter-bar (max-width: 980px) {
  .filter-bar .filter-group-label {
    display: none;
  }

  .filter-bar .identity-filter-group .filter-popover-trigger {
    min-width: 64px;
    padding-inline: 6px;
  }

  .filter-bar .filter-popover-trigger {
    max-width: 126px;
  }
}

@container db-filter-bar (max-width: 760px) {
  .filter-bar {
    gap: 4px;
    padding-inline: 10px;
  }

  .filter-bar .identity-filter-group .filter-popover-trigger {
    min-width: 48px;
    max-width: 92px;
    padding-inline: 5px;
  }

  .filter-bar .asset-color-search > button {
    padding-inline: 5px;
  }

  .filter-bar .asset-color-search > button span {
    display: none;
  }
}
